DnD 5e - Combat Basics
The rules for combat are among the most strictly and clearly defined in the game, and this is important because combat is both contentious and impactful. A single roll of a die can often spell death for a character that you've been playing for months or years. Knowledge of the combat rules will not only make the game work better, but understanding your options can help keep you alive.
Combat is organized into "rounds". If you're familiar with turn-based board games, the concept is the same: Each creature is organized a fixed order (called "initiative order") at the beginning of combat, and each creature takes a single turn in order in each round until combat ends.
During each round, every creature participating in combat will take exactly one turn (again, simialr to a turn-based board game). A turn consists of movement and actions by the creature taking their turn, and potentionally reactions from other creatures. Movement, actions, and reactions will each be covered in detail in the next several sections of this guide.
Positioning in Combat
Where your character is located matters more in combat than at any other point in the game. The difference of a few feat can you put you inside or outside of a fireball, or it might put you just beyond the reach of enemy weapons. For this reason, everyone playing (especially the DM) needs to know exactly where you are at any point during combat.
There are two common approaches to tracking positions in combat: "Theater of the Mind" and "The Grid". Each have pros and cons.
Theater of the Mind intentionally forgoes any sort of physical representation of position. A character's location is described verbally, and is tracked narratively. Rather than measuring out feet, you can simply state "I run over to the door". This is a popular option because you don't need to fumble with miniatures or draw out maps. You're not limited by the physical constraints of real-world space, or by the layout of a grid, which allows positioning to work more naturally. However, it's also vulnerable to subjective interpretation, and it's susceptible to misinterpretation or to simply forgetting things. It doesn't scale well to handle large numbers of creatures, which encourages the DM to limit themselves to encounters with small numbers of creatures.
The Grid is a more mechanical and impartial method of handling positioning. Every creature is represented on a gridded map, typically by a miniature figurine of some kind. Each square represents a 5 ft. by 5 ft. space, and all movement is broken into 5-foot increments.
This allows everyone to know exactly where each creature is located at any given point, and leaves no room for debates about how close or distant to creatures or objects might be. However, setting up a grid for each fight can be disruptive, and hauling around maps and miniatures can be cumbersome. Maps large enough to cover even a few small rooms take up quite a bit of real-world space, which can be difficult if you're not playing at a physically large table.
The full rules for playing on a grid are presented in a sidebar on page 192 of the Player's Handbook.
Personally, I always use a grid, but don't let that color your decisions. Many groups play amazing, exciting games and never once feel the need for a physical respresentation of the in-game world. Do whatever sounds like fun to you, and if you don't like the results, try something else. The only right answer is the one that you enjoy the most, and even then your preferences might change over time.
No two combats are the same, but your goal is nearly always to "win" in some fashion. In most cases, the simplest way to win is to kill your enemies before they can kill you and your allies. Similar to fighting a monster in a video game like final fantasy, you encounter enemies, you defeat them, you look for treasure, and you move on.
However, reducing every enemy's hit points to 0 isn't the only way to win in combat. Remember: Dungeons and Dragons isn't a video game (well, not the tabletop RPG. There are DnD video games.), so video game logic doesn't apply. With some exceptions, enemies typically won't throw away their lives fighting a group of heavily armed adventurers that they ran into by accident.
Dungeon Master is responsible for portraying an internally consistent world, and part of that duty is portraying creatures which the player characters face in combat. While some creatures might fight to the death (zealots, fanatics, beasts defending their nests, dragons defending their hordes, creatures with no regard for their own life like zombies or skeletons), intelligent living creatures can and should choose to run away if the circumstances justify it. Intelligent creatures, especially humanoids, can often tell when they are clearly losing, and an early retreat means that the creature will live on even if it never again comes into contact with the player characters.
Also keep in mind that victory can often be costly. Combat is dangerous, and even if you win a fight, members of your party may be injured or even dead.
If you play this game long enough, you will eventually lose a fight. You and/or members of your party might even die. Your entire party might die. As horrifying as this may sound, death is part of the game, and death is the most common way to lose a fight.
Remember that you have the same options that enemies do: you are free to run away. If there is nothing forcing you lay down your life on the outcome of that fight, a well-timed retreat can often be your best option. When to withdraw is a hard decision, but when things clearly aren't going your way don't hesitate. Living to fight another day will usually have better long-term results than dying.