Bring up the console by holding Shift and pressing the button under escape, and type devmapall. That enables cheats. From there, you can type god to enable invincibility, noclip to fly and go through walls and notarget to make yourself invisible to enemies. Type the cheats in again to disable them.
That's all I can remember off the top of my head, hope it's right.