Usually, I just walk away and take a break from whatever it is that I'm working on, whether it be hobbies, programming, school, etc. Then I come back with a fresh mind to be able to deal with the problem.
EDIT: I forgot to mention that I found out bashing my head against the problem doesn't work real well.
Top comments (6)
I work office/home, but here's some things that work for me:
Depending on how long I anticipate my frustration...
Best things which always help me:
10 minutes meditation. It's more like the daily thing, but you always could try it when you're frustrated. Best apps - headspace, calm.
Walking around with podcasts in the headphones. Music not so helpful, because you still be thinking about things that bother you. And it's better to take non-programming podcast. hello internet, luke's english podcast for examples.
Sport: In my case, it's jogging/running or gym. But I think it could be anything.
Video games/TV shows: It should be something simple and light, nothing serious. Almost all games are suitable, it's better to play on a console while sitting on a comfortable couch in your living room, not in front of the laptop/PC. In case of TV Shows, sitcoms are best.
Read a book. Of course fiction/comic or some novel, nothing serious here as well :)
If the codebase feels overwhelming, I consider if it's time to refactor to make it easier to understand.
Take the dogs, and go for a walk in the woods. I got my best ideas when walking around. I record them on the iPhone voice memos to make sure I don't forget them 😅
Take a smoke :D
Music
Take a break, do something else for like 30min-1h