Even before I get to the answer, let me tell you that during the course of your preparation, you will have to keep studying even when you are not motivated enough. The process is so long, that it is difficult to be motivated for the entire duration of the preparation. Therefore if you are a true IAS aspirant you will keep reading and preparing even when you find yourself wanting in terms of motivation.
That said, let me tell how I kept myself motivated during my preparation.
- Develop a genuine interest in the subjects that you learn: This is very important. Unless and otherwise the topics that you are learning genuinely piques your interest, no amount of motivational quotes or movies can help you. I would say you should become that curious kid that you used to be once. Question everything so that you can understand things better. I was humbled by the amount of things that I did not know about, that I wanted to learn all those things.
- Keep things organised: I have seen many fellow aspirants pile up their books and keep their tables untidy. In the end they end up wasting a day to tidy up their room and within a week the cycle would start again. Treat your study as if it is a temple. As soon as you see it, you should feel like studying.
- Abstain from accumulating too much material: Many people say that for passing the civil service exam you need to know everything under the sun. That is simply not true. I am quite sure that people who say that have not successfully passed the exam. This is an exam like any other with a very defined syllabus. A bulk of that syllabus can be covered by reading standard books. Try to understand which those books are and learn them. Abstain from the habit to collecting every single coaching material and pamphlets that are out there. By doing that, you are setting yourself up for disappointment.
- Find joy by achieving small goals: Set small goals for yourself and congratulate yourself when you achieve them. I will tell you the bizzarest way in which I did this. When the CSE prelims notification came, I created a folder in google drive named Notification and copied the notification there. Then when I filled in the application I created another folder named Prelims application and put in the copy of my application in that folder. Likewise for every single stage of the exam I created a folder by the exact name and placed the concerned documents in those folders. I congratulated myself in every single stage i.e even for submitting the application without any mistakes. I would also dream about creating the next folder. I was so happy when I was able to create the folders for the entire exam process in 2015. It was like a game designed by me.

- Always remember why you are writing this exam: There is nothing that can motivate you more than this reason. Make sure you are fully convinced about your reason for writing this exam. Don’t try to internalise other people’s reason for yourself. Some people might be writing this exam for serving the nation. If you are writing this exam for power or status, then think of that reason only, because only that can motivate you. It is a whole different debate whether you should be writing the exam for these reasons.
All the best in your endeavour.