You can either a) Wake up or b) Learn to control your dreams so that you can either run away, battle the nightmare, or get rid of it.