In my experience, writer's block is usually due to stress, overwork, and/or inadequate self care. This doesn't happen to me frequently, but it does happen.
The solution, for me, is usually to increase my self-care for a few days. (Get rest, make sure I'm sleeping well, eating well, getting exercise, etc.) If that doesn't work then I do a bit of journaling to mull over why I'm having trouble with a particular project. That has helped me out on more than one occasion.