i've struggled with this and come out the other side multiple times. it's horrible to experience it, and the route out is hard, too. what works for me is literally forcing myself to do things i like, even when i get no pleasure out of them. i have to do it over and over and over again, and eventually i'll get a spark of something. then i chase it and use it as motivation.