Combat follows this sequence:
At the start of a battle, each combatant makes an initiative check, rolling d20 and adding their initiative modifier (typically equal to your Dex modifier). Characters act in order, counting down from highest result to lowest. Assuming nothing changes the initiative order, in every round that follows, the characters take turns in the same order. If two or more combatants have the same initiative check result, they can simply decide who goes first.
Instead of acting on your turn, you are free to delay your turn to a later point, changing your initiative in the round. You may delay your turn long enough to end up at the top of the initiative order.
When a combat starts, if you are not aware of your opponents and they are aware of you, you're surprised. Sometimes all the combatants on a side are aware of their opponents, sometimes none are, and sometimes only some of them are. Sometimes a few combatants on each side are aware and the other combatants on each side are unaware. Determining awareness may call for Perception checks or other factors when both parties approach one another to determine who is aware of whom.
In the first round of combat, only combatants who are aware of their opponents may act. Unaware combatants are also flat-footed because they have not acted yet, so they are flat-footed (see AC below).
Each combatant gets a chance to act in each combat round, acting in order of initiative. During their turns, each player gets a standard action, a movement action, and a bonus action.
Standard Action – A standard action is the main action you are able to perform during your turn, usually fighting, casting spells, or some other action that aids in combat.
Movement Action – The amount you move during your turn, equal to your movement score in feet. You may divide your movement action up between other actions taken in your turn.
Bonus Action – An action that takes a fraction of a second that you can do before or after your main action. You may or may not even have something available to do for your bonus action, depending on your abilities.
You also can perform free actions, full-round actions, or reactions. These are described below.