The teddy bear principle
The teddy bear principle is pretty simple: when you are stuck, explain your problem to an inanimate object, such as a teddy bear. During the explanation, your brain will think differently about the problem because it's not looking for a solution. This has lead me to solutions lots of times.
In retrospect, I have been doing this a lot. In my first year in college, there was a dorm roommate that was in her last year of the same IT education. I think I might have disturbed her at least once a month to talk about a problem about programming or IT in general. She mostly didn't explain anything, she just listened.
Later I did it to my parents, having to adjust my level of technical terms according to my audience. My mom understands less than my dad about technology, especially when it comes to programming.
Eventually I started talking to myself. Now, this is probably worrying from a psychiatric point of view. When I explain the problem to myself, I gain new insights because I'm thinking about the problem space. During the process, I find that I discover new solutions almost by accident.