
Surprised
When combat starts and a creature did not realize there was a threat present, that creature is surprised. Usually a creature is surprised because their enemy used stealth to attack before being noticed. In an ambush scenario, the ambushing creatures roll a stealth check. If all ambushing creatures roll equal to or higher than a given target's passive perception score (which is 10 + their perception skill bonus), then the given target is surprised.
A surprised creature has a -20 penalty to their initiative rolls.
A surprised creature cannot use reactions, and has disadvantage on dexterity saving throws.
As soon as a surprised creature ends their turn, they are no longer surprised.
Notes
One member of the party may be surprised while others are not. Perhaps the goblins sneaking up on your party caught the ranger's attention, but not the wizard's.
The GM may decide that the surprised condition is appropriate outside of an ambush. If a doppleganger suddenly sheds their disguise and attacks, the victims are likely surprised, unless they knew the doppleganger was in disguise. Another example would be a supposedly friendly merchant suddenly unleashing a fireball spell upon the party. In this case, you would likely roll the shopkeeper's deception against the party's passive insight scores, similar to stealth in an ambush scenario.