There are several strategies one might use to survive a nuclear attack, and maximize their chances of survival in the wake of the attack. These strategies come from books and public information campaigns including the United States' Survival Under Atomic Attack (1950), "duck and cover" (late 1940s into the 1980s), Nuclear War Survival Skills (1979), and the United Kingdom's Protect and Survive (1980). Though some of these campaigns, particularly "duck and cover," have been criticized by non-experts, experts on the effects of nuclear weapons have generally supported their veracity.
There are a couple myths regarding nuclear weapons that should be immediately dispelled. These myths are 1) that radioactivity is an atomic bomb's greatest threat, 2) that radiation exposure is always fatal, and 3) that atom bombs are always completely destructive within their range. The greatest danger from a nuclear attack are the heat and blast effects, not the radioactivity. Even with exposure to serious radioactivity, eventual recovery is likely with proper medical care.
The first thing that anyone can do to survive a nuclear attack is duck and cover. The first sign of a nuclear bomb exploding is an extremely bright flash. If such a bright flash is seen, you should duck down, preferably in a basement or subway, but otherwise along the side of a building, and cover your eyes and face. This will protect your head, particularly your eyes, from being damaged by the blast heat and overpressure. The blast wave should arrive a few seconds, maybe as long as 45 seconds.
One concern in the case of a nuclear attack is that school students would run to windows to look for the cause of a major flash, only to be shredded when the glass breaks from the pressure wave. In the perimeter of the blast radius, sharp glass will be a major hazard and will likely kill more people than heat.
Critics of the "duck and cover" approach argue that a nuclear attack will kill everyone anyway, so ducking and covering is pointless. This is false. Throughout most of the blast area of a nuclear weapon, the pressure and heat will not be sufficient to kill. At these distances, death or injury is more likely to occur by broken glass, heat, pressure, or flying debris.
After the blast occurs, it is important to wait before running outside. For an airburst, you should wait about a minute, then go out and help fight fires. For a burst at ground level, you should wait at least an hour before going outside, to let the radioactivity die down. At this point, you should take potassium iodide if you have it, which will help protect you against any ambient radiation. If you don't have any, you should try to get some.
As you fight fires and group with other people to get information and directions on what to do next, keep in mind three things: don't take chances with exposed food or water, don't panic, and don't start rumors. If you've survived the initial blast, chances are you'll be all right -- unless chaos is unleashed by rumors or panic. Stay calm and orderly so that no further casualties result. Help fight fires, which will preserve as much of the infrastructure as possible and minimize further casualties.