You can teach yourself to control your dreams. The method is called Lucid Dreaming, which means that you're aware of the fact that you're dreaming. That way you have the freedom to choose how your dreams go. In most cases people turn nightmares into good dreams. You can Lucid Dream for up to 30 minutes if trained properly.