1) Set your body so it is in a straight line from your head to heels. Once you are in the correct alignment, find a spot on the floor that is directly below you, and your eyes should remain fixed on this spot the entire time, which would indicate that your neck has remained in the proper position. If your neck has collapsed, the chances are good that you are now looking at a spot on the floor that is closer to your feet, and this is not good!
2) While maintaining proper alignment, gently tuck your chin down. This will help activate your deep neck flexors.
3) Strengthen your deep neck flexors. If this muscle group is weak, you will be hard pressed to keep your neck up, or will at least jack up your neck extensors and lateral neck muscles as they will be working in overdrive to make up for your weak neck flexors. Many people who suffer from chronic neck pain and/or tension have extremely weak deep neck flexor muscles (and scapula stabilizers).
4) Keep your shoulder blades depressed and retracted. If your scapula stabilizer muscles are weak, you will have a hard time keeping your neck up. Add in some exercises that will address this issue. Some of my favourites include banded wall-slides, scapula push-ups, scapula pull-ups, and face pulls.
5) Here is a trick that I like to use. Press your tongue against the back of your upper teeth. This subtle move will help activate your deep neck flexors, and will help you keep your neck up. I also find that this strategy helps activate the core muscles.