I knew before my boyfriend and I started dating that he was dealing with serious anxiety. He was extremely open about his struggles from the very start, and we still often have conversations on how he's dealing with it day-to-day. Throughout the time we've been together, I've strived to make sure I'm being a good significant other not only in just everyday things but also in how I help and face his issues alongside him. I'm far from perfect, and every case is different I know, but here are some things I've learned from my own experiences that I feel have improved our approach to it.
The first and most important thing I've learned is to never think you can be the solution or the end to the struggle. I knew this early on and so do many others, but there are still cases where people will invalidate their relationships because their SO is still dealing with mental illness. It can be easy to think this way but try not to let yourself fall into this trap that mental illness can set within relationships and fight it by creating understanding instead. To have a better understanding of mental illness, you need to know and always keep in mind that there isn't always a solution, or it isn't as easy as just being with someone who makes you happy. Mental illness is deep-seated, it can show up when people least expect it, and can sometimes overwhelm the happiest moments of your life. Accept that you cannot strive or aim to heal them perfectly just by being their SO, sometimes mental illness just doesn't care.
You can still be open to helping them however possible, as it is an important aspect of making the relationship work, but know the limits. Instead of trying to get rid of the mental illness in one sitting work on finding things that help your SO feel less anxious or depressed, whether it be helping them find a therapist that suits their needs, finding activities that make them feel fulfilled, or just being there to talk.
On a more serious note, make sure to at least try to ask your SO how to deal with episodes, like anxiety attacks or bouts of depression. Knowing for certain how I can help my SO has helped us both a lot in being more comfortable and at ease if an anxiety attack were to happen, or even when his anxiety just pops up in smaller ways.
Keeping that in mind always try to help your SO to the best of your ability, but be able to acknowledge your limitations. If you are not a licensed psychiatrist or therapist never try to diagnose them or give them advice regarding medication, treatment, etc. Sometimes, people think that looking up issues or taking a couple of psych classes gives them the right to diagnose or tell people what to do and this is extremely dangerous. As much as you love your SO, if you cannot help them with certain issues, it is always safer and better to refer them to an educated and experienced medical professional who can.
Mental illness is not an easy topic, and it certainly is not painless for those struggling with it. Mental illnesses can take on so many different faces and names, but when it is your SO dealing with it, you have to learn to accept it and work with it. Being there for someone can seem easy when you care about them, but mental illness can make it feel like a struggle or a true challenge. When or if it does feel that way, always make sure to remember the person you love beyond the illness, the SO who is always there for you, and be there for them in whatever way you can.