I’m very glad you wrote. It must feel terrible to be so confused and depressed. I’m going to tell you what I’m sure you already know. You cannot sort out your identity or deal with your anxiety and depression without also addressing your substance abuse. Both issues have to be dealt with at the same time. One of my guesses is that you abuse drugs or alcohol to deaden your pain. But when you get even a bit sober, your problems are still there.
People with both substance abuse and mental health issues often have family problems. I suspect that your difficulty with relatives is born of shame about your substance abuse (and maybe other things as well). Maybe you protect yourself from judgment by avoiding them and being angry. Strangers (by definition, people who don’t know you) may seem safer company. You can present yourself in any way you want with a stranger, but you can’t fool a relative for long.
I don’t have enough information to comment much on your feelings that you might prefer to be a woman, especially since you stated that you were sexually abused as a young teen. It’s possible that your concerns about your sexual identity are a reaction to the abuse. It’s also possible that you are coming to terms with the feeling that your gender assignment at birth wasn’t accurate. You would find it helpful to confer with an expert on sexual identity to help you sort this out.
A dual diagnosis (substance abuse and mental health issues) tends to be difficult to manage and to have a great potential for relapse. That’s why you need to deal with both at once. Such an integrated treatment usually includes some behavioral therapy (like Cognitive Behavioral Therapy or Dialectical Behavior Therapy) to help you learn new ways to cope with distress, medication if needed for your anxiety and depression, psycho-education to give you new understanding of your problems, as well as relapse prevention strategies. Some programs also include classes in mindfulness meditation as a tool for calming yourself. Close collaboration of your helpers makes success more likely.
I hope you can find a program in your country that can provide you with the guidance and support you need. If not, consider exploring some of the online support and recovery programs for dual diagnosis.
I wish you well.