If you're suffering badly from social anxiety and / or depression then I'd consider an SSRI ideally in conjunction with therapy.
SSRIs are pretty safe. They have some risks associated with them, in particular a new patient might be more at risk of suicide or self-harm, but the side effects are manageable. The thing is to decide whether the upsides balance out the downsides.
TRT also has downsides, including a potential loss of fertility, lifetime dependence, and (possibly) increased risks of prostate cancer and heart problems.
Depression can be tough to treat. Different drugs have different effects on people, and so you might need to try a few medications before you find one that works.
If you are on an antidepressant then you can stop taking it. It's not a lifetime therapy. Coming off can be rough.
There's a relationship between depression and low T, but it's not clear whether it's a cause or a symptom. TRT can help, but it's more useful when mood is persistently down, rather than a major episode.
Bignoknow's YouTube channel has a fair amount of content about depression and low T. If you're going down the TRT route then it'll be worth a look.