To make an attack, choose a target within range, determine modifiers, and make the attack roll. An attack roll is a d20 plus the appropriate modifiers. If the total equals or exceeds the target AC, the attack hits.
A natural 1 on the d20 misses. A natural 20 hits and is a critical hit. When you have advantage or disadvantage, roll two d20s and use the higher or lower result as appropriate.
If you attack a target you cannot see, the roll has disadvantage. If you are hidden when you attack, the attack usually reveals your location after it resolves. If a creature cannot see you, your attack against it has advantage.
Ranged attacks use normal and long ranges. Attacks beyond normal range have disadvantage, and attacks beyond long range cannot be made. A ranged attack has disadvantage if a hostile creature that can see you and is not incapacitated is within 5 feet of you.
A melee attack usually reaches a target within 5 feet unless a weapon, monster trait, or other rule gives a longer reach. Opportunity attacks use a reaction when a hostile creature you can see leaves your reach.
Two-weapon fighting lets you use a bonus action to attack with a different light melee weapon after attacking with a light melee weapon in one hand. You do not add your ability modifier to the bonus attack damage unless that modifier is negative.
Grappling and shoving are special melee attacks made with the Attack action. Grappling uses a Strength (Athletics) check contested by the target Strength (Athletics) or Dexterity (Acrobatics). Shoving uses the same contest to knock a target prone or push it 5 feet away.