The first thing you have to do is have patience with yourself. Admit that yes, you're not writing—and then remind yourself that's all right. It's okay to be stuck. It's not the end. It's normal. Every single writer goes through it, including award-winning ones. Remind yourself it's okay if you haven't written in a while and that when you've written, it's often been terrible. Again - this is normal.
The next thing you have to do is start refilling your creative well. Ask yourself: when was the last time you enjoyed something creative? When did you read a book that filled you with the love of stories, or watch a movie that fired your imagination, or spend some time enjoying music or some other creative art just for beauty's sake? Too often, we find we haven't been enjoying arts. We've either been ignoring them, or trying to read in some strange, analytical way that leaves literary food devoid of nutrients.
And the final, terrifying thing: give yourself permission to suck, then write. This is THE HARDEST PART about the slow recovery from writer's block. Write something. Write anything.
It will suck. It will NOT be creative. It will, in fact, be terrible. And that is okay. There really is no other way. Those three steps work, but they are not easy.
They are worth it. You can do this. Please don't give up.