This.^^^^^^^
Training is primarily a psychological challenge...plain and simple. Believe me, if it were simply about carbs or pre-workout supps. I would have died a long time ago.
If you fixate on all of the secondary aspects of training/working out, such as those mentioned above, and don't have the proper mindset....sure, you'll crash and burn. This is completely normal....happens all the time.
Personally, when I lose focus or get frustrated, I'll just stop for a minute, take a quick stroll down the hall or find a temporary diversion, get my head back in the game and go back to work. Even though I'm not a big fan of hanging around between sets, there is no written law that says you have to complete your workout within a certain period of time, or run straight through your routine. Just take a breather, remind yourself why you are there, and jump back on it. If this doesn't work.....Get MAD.....seems to help me.