Using Left-Right arrows, avoid the asteroids, the TIE fighters, and any laser shots. Use Up arrow to go into hyperspace -- you can only use this once every 20 seconds.
This is adapted from Star Wars Coding Projects, by Jon Woodcock.