Feeling lost while doing preparation is normal. With time the reason for feeling lost will change but it will remain . It's normal. Here emotional intelligence comes into play. 1)1. Clarify your ultimate goal-Why UPSC? Why not any other exam/job/vocation? This is the hardest to answer because it requires a great deal of SELF-AWARENESS, it is probably the toughest question to answer before, during or after the prep (even after selection, most have no clue about this answer truly). But the key lies here, for if your purpose is clear, personal to you, means something substantial to YOU, then you will find the capacity to tolerate, endure and survive these hurdles. Then, emotions will seem like passing weather, not affecting your core determination. Virat Kohli can survive unimaginable stress and training on his body for the sake of cricket, but put him in UPSC prep and he will run away after the first Polity class that teaches the difference between Written and Unwritten Constitution :P
Identify obstacles to YOUR goal. (eg-lost in thought, indiscipline, emotional turmoil, thinking about the future, etc)
Identify CAUSES to these obstacles to YOUR goal. (eg-one or more 5 sins, jealousy, hatred, fear)
Find a plan to make them go away. It is here, that different strategies are provided (exercising, writing, studying, doing another job, etc). THEY ARE NOT THE SAME FOR EVERYONE. Please, do not follow them blindly, trust your gut instinct to guide you. If exercise feels like a futile thermodynamic enterprise, DO NOT do it.
Point 1 is the most basic. It is 80% of the problem, in my opinion. How to clarify your purpose? There are different ways, one of them may work:
Self-introspect-ask yourself this question genuinely and intimately. Try to find the answer, it will be lurking where you DO NOT WANT to look, because either you are afraid of the answer, or you are afraid of the unknown fog. Either way, this is the only way to know yourself. It is here that, one of the ways, meditation is suggested.
Talk to trusted people, open up and discuss your deepest fears. This is a bit risky, because it is hard to know who to trust, and even those who we trust might not be at the same level to understand what's going inside our heads. Sadly, this is the truth. If it works, well and fine, if it doesnt, go back to point 1.
So, this is the path to overcome emotions. Clear your purpose, then you will be surprised at the strength you have to endure pain.
All the best!