If I am trying to solve a task (e.g. to fix an issue), applying different methods and approaches and have no success after an 1-1.5 hour, I start loosing my patience. I like the Dalai Lama point: "while we cannot stop an unwholesome thought or emotion from arising, we have the power to let it go, and the highly trained mind can let it go the moment it arises."
This exercise can help to manage a negative emotion, as if you can analyse a cause of it, it is at least a half-way to control your feelings.