In an active shooter situation, your first priority is to run.
If you can’t do that, the next best option is to hide, and to hide in a room with a locking door. Attackers are looking for easy targets, and will often bypass a locked door without trying to breach it.
If the door of the room you’re in doesn’t lock, then you’ll want to barricade the door (and you should do this even if the door does lock, simply to create extra protection). When barricading yourself in a room, you want to create what security professionals call “layers of protection,” so that if an attacker breaches one obstacle, he’s faced with another.
The first step in creating security is simple situational awareness and reconnaissance. Whenever you enter a room, you should know where the exit points are, and whether the door(s) swing outwards or inwards, as this orientation will dictate what measures you use to secure it.
If the door opens outward (towards the shooter), there are various methods you can use to jerry-rig it closed. If it opens inward (towards the room you’re in), you can wedge something in the door to keep it shut. In either case, it’s advisable to stack furniture against the door to create an additional layer of security: the shooter, who again is looking for easy targets, may choose to move on rather than wade into the barricade; even if he does attempt to breach it, the obstacle will give you time to launch a counterattack against him. If you have “ownership” of the room (e.g., you’re a teacher and it’s your classroom), consider positioning the room’s furniture near the door normally, so that you can quickly move it against the door in an emergency. Once it’s barricaded, you want to get away from the door as quickly as possible, in case it is physically breached or shot through. After you’ve secured the door, position yourself away from it and against a wall.
While it’s unlikely you’ll ever need to employ these tactics, people really have done so in real-life active shooter situations, even googling “how to secure a door” in the midst of the crisis. Rather than be fumbling with your phone in the heat of the moment, study the tips above, and you’ll be ready to employ them in an emergency.