Some people have mental health diseases.
They can’t help it. Yes, it’s frustrating and tiring at times to be around them.
They should be getting professional help. If they aren’t seeing a counselor and/or a doctor, encourage them to do so. If they stubbornly resist getting help, then you might gently limit your contact with them and tell them that it’s too hard for you to see them neglecting their health in this way.
If the person is getting the help they need, and is making a reasonable effort to be a decent friend and not just use you as a shoulder to cry on or a support system for their illness - in other words, you have an actual friendship with give-and-take going on except that your friend is not feeling well sometimes - then I would continue trying to spend time with the person doing things you both enjoy. If something doesn’t work out because the person is depressed that day, then just gently suggest that maybe you’ll get together another day when your friend is feeling better.
Also, feel free to set limits on the friendship. You don’t have to be available to this person every time they want something, in order to be a supportive friend. You have to also have time to lead your own life, which might include doing things with other friends who aren’t depressed. Also if the person behaves abusively or toxically towards you, then disengage. Tell them flat out that their behavior is inappropriate, that you are going to leave now (or hang up the phone or whatever) and you will talk to them again another day. Unfortunately, I have know mentally ill people who will kind of take out their anger or their pain on their friends and it’s inappropriate. The illness doesn’t excuse it.