For me at least, writer's block usually stems from worrying that what I'm writing isn't "good enough"... when this happens, I remind myself that no rough drafts are perfect and, as one of my creative writing professors used to say to us in college, words down on the page are ALWAYS better than words just in your head.
If you're working on a longer project, maybe you simply need to take a break. Try to writing a short story featuring some of your characters, or even a short story featuring entirely new/different characters. This can help you see the idea from a new angle, get excited about the idea again, and get to a "finish line" of a shorter project. That might be just the motivation you need to dive back into the longer work with your batteries recharged!
Most of all, I always encourage my students and mentees to go after the idea that is sparking inside you, the one that makes you excited. There is no time to waste! Write what makes you feel alive.
If it's the idea you're working on now, great! If you wants to try something completely different and new, that's great too! Remember: you can always return to this idea later if you want. No idea is ever wasted or abandoned.
Finally, here's the number-one thing that works best for me when I'm battling the writer's block blues, and that has made the biggest difference in my productivity, creative energy, and happiness as a writer: write every day.
Make writing a routine. I think even trying to write at the same time of the day is best, because you train your body to prepare to write during that time -- much in the same ways athletes often practice at the same times. Then, when that time hits, you are ready to go! It's like a muscle memory you are building.
Even if you feel like the writing isn't flowing, even if you feel like every word you are writing is terrible, stay in the chair and keep pushing through to the good stuff. Because the good stuff will come, believe me. You just need to have the patience to get to it!
Here are a couple other articles I found that might be helpful, too: