There have been some good replies on this thread, sleep being one of the most important. Rem sleep is vital. This is often impossible in hotels where, no matter how may times you explain...plead...beg, someone will come into your room and Hoover your pillow at some un-Godly hour, because it is convenient to their schedule and to Hell with the guests.
Try hard to remember, and attempt to make a mental log of what you were thinking at the point of self doubt about the task in hand. For instance, if you could catch yourself thinking about someone's illness, or a bank manager's letter, and it became apparent that this or similar thoughts were invading your mind repeatedly during critical work, then you would be well on the road to being able to self analyze and remedy the problem