system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: Why do our brains think of embarassing moments when we try to sleep?

It sucks.
gpt
I read an article saying it was to protect us. In hunter-gatherer times, if we weren't paying attention to the cliff or tiger ahead of us because we were distracted by a beautiful sunset, it could come back to bite us later so if you find yourself agonising over mistakes made at work, it's likely you are assessing your performance and looking out for your livelihood. So thinking over how awkward you were at that party is likely your brain is assessing the "threat" of not being accepted. And trying to remind you not to do that next time.