It's quite strange that the best policy for solving problems or ideas is to go to bed. Why?
If a solution cannot be found and you are pulling your hair out for the answer, it is best sometimes to sleep on it. In other words distance yourself away from the problem which will be still churning around in your subconscious mind while in relax mode.
Later or the next day your mind will have surveyed the problem and provide you with more ideas on how to achieve and answer and it didn't involve work!
So if faced with a dilemma sleep on it, it will be okay the next morning.