I tried meds several times over the decades where I was going to therapists for depression but not confessing my "shameful" feelings about my gender. After making a serious suicide attempt about 2.5 years ago my therapist insisted I go see a psychiatrist or he'd have me committed. For the first time (to a psychiatrist) I came clean and we started trying drugs and eventually hit on something that's been remarkably helpful - for me.
Here again, speaking only for myself, it was like I had to gain a new mindset about meds and what they do. In years past I'd hoped that the pill would clear the depression and life would go on, depression-free. Of course, that didn't work. I finally (perhaps as a result of finally receiving a drug that was effective for me) discovered that I really did have two things going on: 1) a problem in my brain chemistry that was addressed, thank goodness, and 2) my shame and fear around my gender dysphoria which has also much improved after transitioning, HRT, and living more authentically.
It's all so complicated especially for adults like us who've developed coping habits that, to some extent, we also have to undo. I suppose those habits are still with me but I do seem to be getting better, with a happiness and peace that I've never in my life felt before.