The first thing to do is establish (or re-establish) your identity. I find that clear self-knowledge enables discernment; that is, if you know what you are and aren't (and are clear about things you haven't fully established), you can use that knowledge to tell you when things that shouldn't be influencing you are present. As your self-knowledge improves (and you should study yourself at least a little every day, which can easily be worked into a meditative practice) you'll be able to spot inconsistencies and errors, as well as ways to correct your own faults (provided you've properly examined the worldview from which your understanding comes). I started with an integrative approach, trying to accept all my aspects without forcing them to all be the same person, and then working out how I can be each of those things without not being the other things. Initially, I had to deal with inconsistencies by allowing them to be mutually exclusive, but over time I have been able to accept and build each of these things into a single united identity instead of fragmented aspects or presentations. I should note that you don't have to accept everything as a "must be", so much as a "might be"; I realized early on that I have a strong feminine quality, and asked myself if I was transgendered -- and realized that I was happy with my body, no matter what gender was inside, even if I had no particular attachment to having male genitals, and that living as female wasn't the point for me. Remember to question your assumptions regularly, as your identity changes over time as a result of your experiences and understanding. Who you are now is not, or at least should not, be who you were five, ten, or twenty years ago -- although the foundational aspects of your life, and the identifying markers of your personality may still be present.
Second, a clean spirit enables self-cleaning abilities. This may seem circular or recursive, but actually it's more that wallowing in pollution will clog you up so that you eventually can't function. Thus if you are stuck in despair, then fear must lead to an outward charge and anger must drive you forward, instead of pushing you back down into despair. It's like blasting nitrous oxide through your car's engine: it'll tear it to scrap over time, but that burst of stimulus can provide enough energy to get you one step closer to health. As you grow healthier, continued self-examination and questioning should eventually lead to you asking whether you need your old self-motivating tactics, which should lead to choosing healthier means of moving forward.
Acceptance of one's experiences, and analysis of those experiences in their own and in external contexts, are fundamental abilities if you expect to get beyond an existence grounded in "I want." If you can't accept what you have perceived, no matter how strange or distressing, then you won't be able to process it. Until you can accept it, your mind will either hide it/from it or continuously replay it. Once you can accept it, you can then begin to understand it. This is how PTSD works, and the primary means of recovery therefrom. You get the crap out of your life, and bring in good energy, and then your mind can finally start to let go of the stress you've been through and process your experiences instead of react to them.
Meditate. No matter what form it takes, from counting to ten when you're upset (or even just worried) to visualizing your daily actions to spending half an hour or more with your eyes closed and your mind blank. I don't care how you do it, or what it consists of. It doesn't have to be a ritual, though making a regular habit does help when you're starting out. Meditation helps you to calm yourself, achieve a centered state, and function even in the midst of panic or angry outburst. It gives you a moment to think instead of recoil, so that you can take a deliberate action or make a specific choice. It also allows you space to examine yourself (and others) without judgement, reserving that judgement for the period afterward when you can organize your observations. Coming back to gender issues, I had to think through what I wanted, several stages ahead, and I had to process all this in a mental space where anything I wanted was okay as long as the end result made me healthier and happier. Once I knew that the end result didn't matter as far as changing my body (and this took several years to fully work out, during which time I did in fact move toward expressing myself physically in more feminine ways, without specifically stepping into a female role), I actually fell into a more comfortable space as regards my body and my gender. That space was made by meditation, and by processing the issue fully while acting on it partly (in other words, by experimenting with what it meant to me, and then analyzing the internal results in my daily meditations).
Another good rule is that the principles of good physical health, good mental health, and good spiritual health are essentially the same. If you destroy one or two in pursuit of perfecting another, then you have ruined an incredible gift for the sake of having something else. You can have your desired extremes and do well with them, but you have to have balance and a moderating structure or you'll just swing wildly like an unregulated pendulum, and eventually the whole thing will collapse. Eat reasonably healthy, put healthy things into your mind, feed good experiences to your soul. Exercise your body, exercise your mind, exercise your spiritual self. Learn how to deal with bad stuff, even if you don't have to do it regularly; but put the bad stuff out of your personal practice when you can. Accept the difficult parts, even if you can't accomplish them, because it is the difficulty which points out where you need to grow, and which helps you find the limits of your present capability -- so keep pushing at them, but not to the point that it causes damage.
As you grow healthier, eventually you'll be able to work on your problems more and more directly. Right now, I'm finding that self-confidence alone is one of my biggest problems: it holds me back in many areas of my life. I'm also finding the problems behind my weak self-confidence, and working them out, which in turn will bolster every area of my life. If you don't build a better foundation, then every problem you fix will just keep pointing back to that bad foundation; the cracks in the walls, the sagging porch, the split in the roof, the ants in the pantry even, will all go away once you shore up and repair the foundation... which must be built on stable ground, or the ground will continue to give way and make it fail again.
Which means that sometimes, you have to go all the way back, and fully re-establish your identity. You'll have to examine everything and learn who you are all over again -- perhaps even place yourself internally in a whole new environment... and then build from there.
Nothing you learn is ever wasted, but sometimes you learn that what you already know had a bad foundation. If you did it right, though, what you learned before will have taught you how to do it right again, rebuilding all the way from one end to the other on the newer principle.
So finally? Learn how to learn, and in so doing you will never have to do anything by rote again. Even if you do end up having to memorize a few things along the way.
ETA: I should note that these are the generally-applicable things. I'm not including the energy work I do here as its practice is essentially a tool that enables these other things in a more direct manner; but you can establish your own practice which enables such a thing a thing for yourself.