I really do feel your pain, as I have been through similar mental struggles before (and still do occasionally). One remedy I've found is to release a MVP or show your work to others, as it helps to reaffirm what you are doing isn't a complete waste of time. Launch early if you can and once people start using your it or you start making money, it's much easier to keep pushing forward. This one is more of a reminder to myself than anyone else but your product doesn't have to be absolutely perfect before you launch. Quality control is important but striving for perfection can be an impossibly long journey that can quickly lead to burn out.