This varies significantly between songwriters. Everyone experiences writer's block, but typically, each songwriter will know how to find inspiration. I use loops from Splice, listen to music I love, go for a walk, or go to the gym. A lot of the time, you're overthinking it and are getting in your way. Removing yourself from the situation can help you gain perspective and bring new ideas.