Yeah, I know that feeling - it is hard to get past it when it happens and it certainly takes a while for me every time it happens.
This is certainly not a universal cure, but for me the ideas presented in this ted talk have helped: https://www.ted.com/talks/dan_gilbert_asks_why_are_we_happy?...
So, set a goal and work towards that - but, looking at your profile that suggestion seems trite and silly, because you are and have been doing that for some time. Doing difficult things falls into the same category.
My suggestion would be to pick something completely pointless - something that you could easily pay someone to do for you, better than you have time-skill for and then do that.
For example, I'm building a house. Fairly big, not huge, wooden. I have no training in it and it has taken 5 years of evenings and weekends so far. Any reasonable construction team would have finished in 6 months and it would have had better quality of work.
I love it - it makes me happy to look at the small bit that I finished yesterday and somehow it gives me a sense of purpose. Maybe it's just a distraction - something to keep away the existential dread, but so what, because nothing has intrinsic value, this purpose is the best possible purpose for me.