I want to break up with my partner but I am worried what he/she will do because he/she is very depressed.

You are being thoughtful but staying together may not be helping either of you. Depression is serious and needs to be treated. Knowing that your partner is getting professional help will make it easier for you to leave the relationship. If your partner is making idle threats this may be part of trying to control you to make you stay. Identify other people who can support your friend before you leave and maintain your support if that is what your partner wants.