So far my late teens are mentally healthy but I am aware that this could change, and I think there is only so much you can control as a parent. There are several things I think I have noticed that I may do/don't do that are different to the parents of kids that do seem to have more mental ill health: I don't stress them about doing well at school - both are high achievers but I always say relax, exams are not that important, it's a game you have to play but no reflection on your value as an individual.
Secondly I have made them politically aware - a lot of mental ill health is caused by social expectations/capitalism/sexism - eg expectations on girls to look or behave a certain way. Critical thinking is important to mental health - encourage them to ask questions and understand why things are a certain way and do something. Both involved in youth politics.
Thirdly good diet - they had no junk food at all as babies/young children - and I home cooked all their food for the childminder even though I worked full time in snr job and commuted. Lots of fruit and veggies, beans, nuts. Lots of fresh air and walks. Also not a fan of computer games so no consoles etc for mine, but fine to them to play when at friends. Extended breast feeding for both and never let them cry it out. A crying baby was always cuddled. No idea if any of that helped or not but felt right to me.
Things I have noticed about less happy teens - a lot of them are put under pressure by parents (one particularly loopy Mum had daughter doing homework on phone as we drove back after a concert at 11pm). Not accepting their child's sexuality is another one or teen wanting to go a different route in life to what parents expect. My kids know the only way they can disappoint me is to behave unethically or hurt someone.
I also have some friends with teens with mental ill health who are brilliant parents and unfortunately their child struggles. I think you just try your best but there are no guarantees.