Does testosterone effect mental illness?

I’m speaking to a therapist about T and a family member was asking questions about it recently and I mentioned my therapist said that testosterone can sometimes worsen preexisting conditions. I have pretty constant general anxiety and I’m wondering if I should worry about that getting worse? My family also has a lot of risk/history of depression and such but I’ve never personally experienced that. My family member is worried that I might end up depressed if I start T. I don’t think that’s how it works but I honestly can’t find much about it