DM guide: Running the Game: Resolving Outcomes Part 1
You decide when a player makes a d20 test based on what the character is trying to do. Players shouldn't just roll ability checks without context they should tell you what their characters are trying to achieve and make ability checks only if you ask them to. When a situation comes up and you're not sure how to adjudicate it using the rules use these questions to help you decide
Is a D20 test warranted: If the task is trivial or impossible don't bother with a d20 test. A character can move across an empty room or drink from a flask without making a Dexterity check whereas no lucky die roll will allow a character with no ordinary bow to hit the moon with an arrow. Call for a d20 test only if there's a chance of both success and failure and if there are meanigful consequences for failure.
What kind of D20 test: If a character is actively trying to do something use an ability check. If the character is reactively trying to avoid or resist something use a saving throw.
Which ability does the test use: Think about which ability has the most influence on a character's chance to succeed on the ability check or saving throw. Also consider whether a skill or tool proficiency might apply to an ability checks.
What's the DC: Based on how hard you think the task should be set the DC as follows 10 for easy 15 for moderately difficult or 20 for hard.
Ability Checks: An ability check is a test to see whether a character succeeds at a task the character has decided to attempt.
Proficiency: When the rules or a published adventure calls for an ability check a skill or tool proficiency is often called out for example "a character who succeeds on a DC 15 Intelligence (Arcana) check can puzzle out the magic involved." Sometimes the rules allow for any one of 2 or more proficiencies to apply to a check. When deciding what check a character should make be generous in determining if the character's Proficiency Bonus comes into play. You might specfically ask for a Intelligence (Arcana) check or you can ask for an Intelligence check and let the player negotiate with you to see if one of the character's skill or tool proficiencies applies.
Trying Again: Sometimes a character fails an ability check and the player wants to try again. In many cases failing an ability check makes it impossible to attempt the same thing again. For some tasks however the only consequences of failure is the time it takes to attempt the task again. For example failing a Dexterity check to pick a lock on a treasure chest doesn't mean the character can't try again but each attempt might take a minute. If failuire has no consequences and a character can try and try again you can skip the ability check and just tell the player how long the task takes. Alternatively you can call for a single ability check and use the result to determine how long it takes for the character to complete the task.
Group Checks: Group checks are a tool you can use when the party is trying to accomplish something together and the most skilled characters can cover for characters who are less adept at the task. To make a group ability check everyone in the group makes the ability check. If at least half the group succeeds the whole group succeeds. Otherwise the group fails. Group checks aren't appropriate when one character's failure would spell disaster for the whole party such as if the characters are creeping across a courtyard while trying not to alert the guards. In that case one noisy character will draw the guards attention and there's not much that stealthier characters can do about it so relying on individual checks makes more sense. Similarly don't use a group check when a single successful check is sufficient as is the case when finding a hidden compartment with a Wisdom (Perception) check. Consider using group checks in situations such as:
Research Tasks: The characters are trying to learn about an ancient prophecy from an archive. The characters make a Intelligence (Investigation) check to find sources in the archive characters who are knowledgeable about such topics and about research methods in general can tell the other characters the most likely places to direct their search. If the group check is successful the characters find enough different sources to paint a clear picture of the prophecy otherwise their information is incomplete.
Roped Together: The characters are tied together as they scale a cliff or cross a rickety rope bridge. If one or 2 characters the successful characters can stop their fall and prevent such disaster but if more than half the party fails the whole group fails. You could also apply this idea to something like a long swim where strong swimmers can help weaker ones.
Social Situations: One character offends someone at a diplomatic event and a noble demands the adventurers be escorted from the premises. The characters can make a group Charisma (Persuasion) check to avoid getting thrown out they just need a few convincing arguments and the ability to smooth over any gaffes. You could apply this same principle to other Charisma checks using Deception Intimidation or Performance.
Passive Checks: Ability checks normally represent a character's active effort to accomplish something but occasionally you need a passive measure of how good a character is at doing a thing. Passive Perceptions is the most common example. You can extend the concept of a passive ability check to other abilities and skills. For example if your game features a lot of social interaction you can record each character's Passive Insight score calculated in much the same way as Passive Perception: 10 plus all modifiers that normally apply to a Wisdom (Insight) check.
Attack Rolls: In combat an attack roll is used to determine whether an attack hits. You can also r use attack rolls to resolve noncombat activities that are similar to attacks used in combat such as an archery contest or a game of darts. Assign an AC to the target decide whether the character is proficient wiht the weapon used then have the player make an Attack Roll.
Saving Throws: In contrast to an ability check a saving throw is an instant response to an effect and is almost never made by choice. A saving throw makes the most sense when something bad threatens a character and the character has a chance to avoid or resist it. Most of the time a saving throw comes into play when an effect such as a spell monster ability or trap calls for it telling you what kind of saving throw is involved and providing a DC for it. In other situations that call for a saving throw it's up to you to decide which ability score is involved.
Difficulty Class: You establish the Difficulty Class for an ability check or a saving throw when a rule or an adventure doesn't give you one.
Very Easy: Most people can accomplish a DC 5 task with little chance of failure. Unless circumstances are unusual let characters succeed at such a task without making a check. Although Easy is DC 10 Moderate is 15 Hard is 20 Very Hard is 25 Nearly Impossible is 30.
Easy Moderate and Hard: These are the most common difficulties and you can run your game using only them. A character with a 10 in the associated ability and no proficiency will succeed at an easy task around 50 percent of the time. For a moderate task a character needs either a higher score or proficiency to have a similar chance of success whereas a hard task typically requires both to have a similar chance. If you can't decide between 2 levels of difficulty choose a DC somewhere in the middle such as 17 or 18 fir a task that is a little easier than hard.
Very Hard and Nearly Impossible: A DC 25 task is almost out of reach for low level characters but more reasonable after level 10 or so. Low level characters have no chance to accomplish a DC 30 task while a level 20 character with proficiency and a relevant ability score of 20 still needs a 19 or 20 to succeed at a task of this difficulty. If you're setting the DC for a saving throw don't go lower than 10 or higher than 20.
For some ability checks and most saving throws the rules default as 8+ability modifier+ Proficiency Bonus