There are 3 hazards:
Bars - These come out at you. There is not much you can do about this except having extremely fast reflexes.
TIEs - These appear behind you and shoot at you. To dodge the lasers move in circles, using all the trench room to manoevre.
Y-wings - These bastards fly over the trench and nearly always collide with you, so stay in the trench at all costs!
Here are some tips:
1: set the skill level to apprentice
2: use your targeting computer to determine how close you are to the target
3: when the target is less than 5000 units away, go as close as you can to the trench floor. In this game, the torpedoes are not torpedoes but bombs, and the target will go past very quickly.
4: don't be discouraged if you dont get it. I've played thousands of times and only won it once.