I haven't had writer's block, per se, but I have had times that I could not make myself sit down and write. I would rather clean out my gutters than write. On those rare occasions, I give in and let go. I work on book promotions, such as social media, or outline my next book project. Or I go to the movies or play with my dog. If I fight it, I know it won't be a productive writing session. This will make me more stressed and frustrated and lead to it taking longer to get back on track.
I have read that one of the best things to do if you have writer's block is to try a creative writing exercise. Also, consider it a 'win' if you get something on paper. This means not being overly critical or over analyzing your writing. There's time to play editor later after you have gotten your groove back.