Therea are several tactics.
i.e: you can read the Seawolves Bluebook (in download section of
www.subguru.com) and ther's a section about that.
There's no a "universal" question about this, and after many tries and visits to the bottom, you will find your way.
I can say mine to you: is not very pollished, because I'm not an expert (even advanced), but many times works.
First, don't panic. Look the torp on your sonar screen. If is faint or you can't hear it, be calm, it's far. If you can see it clearly, is close, but not panic yet.
Look the movement, if the signal is moving, probably is not going to your direction, so the better thing to do is remain quiet and, if you judge is nedded, set course to opposite direction (because maybe when the torp becomes active, can catch you).
If the signal remains still... well, the torp is on your direction and very probably is closing. You can begin to panic
Now begins the personal way to evade. I've read about launching active or passive decoys depending if the torpedo is active or passive, but I'm not feel confindent with that.
My first move when I'm sure the torp is heading to my sub and it has possibilities (you will know that with practise), is manouevering my sub with the torp on a 45º angle of my stern, acceletare (but not to flank yet) and launch the two types of countermeasures on the opposite depth. After a while, when I'm sure the countermeasures are between the torp and my sub, I make a 90º turn and launch another couple of countermasures in the middle of the turn.
Contiune running for a while and then reduce to listen, many times I evaded the torp just with this.
If the torp continues behind you, begin to think on more agressive manoeuvers and at more speed... and yes, you can panic
Hope this helps.