As someone whose struggled with depression and seen it affect my significant other, I can relate. The most important thing is that you exercise patience and understanding. It's not something he can snap out of, but with the right support he can likely grow out of it. Here are some things that I think are really important.
His depression is internal, and not by external factors such as you or stress at work or money troubles. It's an unfortunate glitch in his head that makes it hard for him to focus on anything but the bad. Chances are, he knows it's his problem and this can exacerbate his depression. What's wrong with me? Why can't I just snap out of it? How could I let this get so bad? His self worth is probably quite low, so understand that as difficult as he may be towards you or others, he's being a lot harder on himself than he is on anyone around him.
It's never a bad idea to remind him of the good. Don't do it in a patronizing way ( How can you be so down when you have x, y or z!? ), but rather offer him glimpses of the things he enjoys that don't demand anything of him. Sex isn't ideal here because it demands some level of physical or emotional contribution. Rather, surprise him with his favorite foods, put on movies that you know make him laugh, or offer him a back massage. The more opportunities you give him to enjoy himself, no matter how small, the higher the chances he'll smile at one of them.
Give him something to look forward to. He knows he feels shitty in this moment. He doesn't want that to last forever. If you give him something to look forward to in the somewhat distant future, he may get excited enough about it to make a turnaround. Throw him a birthday party with all his friends, take him to see his favorite band or standup comedian, or plan a vacation to a place he'd love to go. Don't make these plans for so soon that he's left with little time to recover. He'll just feel defeated. Don't make these plans so far in the future that he feels like he has forever until he gets to experience them. Make plans that are a couple months away or so, and he'll likely feel like he can be someone who enjoys himself and life enough by then to really look forward to it.
Balance space and support. Don't smother him with your efforts to make him feel better, but don't let him think for a second you don't care about his recovery. It's important that he knows you love and support him and think highly of him. If he sees you consistently treating him lovingly and respectfully, it may catch on to him that he's worth treating himself in the same way.
I hope I didn't make this all sound too difficult or daunting. It's troubling to feel depressed, but when you see it affecting your loved one, it can hurt a hell of a lot worse. He doesn't want you hurting just as you don't want him to. Ultimately, recovery is up to him. If you balance the above points however, you can make him more comfortable about achieving it. Good luck to you both and I hope to hear in the future that you're each happy and healthy.