Most of the time, you only care if you succeed or fail. You succeed on a roll whenever the check result is equal to or greater than the difficulty; you fail on a roll if your check result is less than the difficulty. If the check result is exactly equal to the difficulty, you only achieve a basic success - you succeed, but only barely. This has no effect on gameplay, but can sometimes add cinematic flavor to the flow of the story.
Whenever you roll a natural 20, if the check result is sufficient to have succeeded at the roll, you achieve a critical success. Critical successes with attack rolls are called critical hits. When you achieve a critical success, you perform the action spectacularly well, and may optionally negotiate a relevant benefit from the DM. Certain special circumstances may allow you to achieve a critical success on a natural roll of 19, or even lower. You must still succeed at the roll (i.e., have a check value higher than the difficulty) to achieve a critical success.
If the difficulty of a check is ever higher than your total modifier + 20, you can only succeed at that task by sheer luck. If your natural die roll is a 20 before any modifiers are applied, you still achieve a basic success (but not a critical success) on that task - luck was simply on your side.
On the other hand, whenever you roll a natural 1, if the check result was insufficient to have succeeded on the roll, you achieve a critical failure. Some horrible mishap occurs, causing complications that are either specified by the task you were attempting, or up to the Game Master to resolve. Most critical failures that happen during a combat encounter will cause the critically failing character to grant advantage to all enemies until the end of their next turn. Even if your check result was sufficient to have succeeded on the roll, you still achieve a basic failure (but not a critical failure) on a natural 1 - you were simply unlucky.