Modern vehicles have electronic ignitions; most of them also have electronic shift lock, often included as a safety or anti-theft feature. This presents a problem if your battery is dead; without power, the electronic shift lock cannot disengage with the key in the ignition. All vehicles with electronic shift lock have a manual override, allowing you to bypass the feature in emergencies.
Set your parking brake for safety. Some vehicles use a handbrake next to your gear selector; others use a pedal brake, which is usually to the left of your brake pedal.