I think everyone needs a regular dose of motivation.
1. Motivational talks. They mostly appeal to your base emotions (greed, lust, pride, laziness, etc). So for a while, you feel motivated. But there's a point where you want it so bad but hate the process, leading to burnout. Treat it like junk food - a little is fine, but don't make it your main.
2. Fiction. The opposite of motivational talks. Motivators appeal to your conscious, fiction appeals to your subconscious. Comic books are the most efficient form IMO. Series, especially anime and Netflix, can be very inefficient. This is your bread and butter of motivation.
3. Watching people do good work. Code is hard, because people rarely record themselves in flow. Music (e.g. guitar, freestyle on Omegle videos) is very accessible. Also handwork - people fixing stuff, restoration, Mythbusters style edutainment-engineering. It motivates you seeing what skilled people can reach, but on the other hand, may make you give up.
4. Mentoring. My most motivated period was going through Sam Altman's startup classes [1]. There's very few truly good sources; most technical content today is plagiarized and a form of self-marketing. Lots of stuff on Udemy, etc, are just mediocre. But find yourself a good class or teacher, and you should also get a burst of motivation.
[1] https://startupclass.samaltman.com/