Attack Roll. When you make an attack (melee, ranged, or spell), your attack roll determines whether you hit or miss. You hit if: your attack roll ≥ target’s AC.  If you hit, then roll for damage.

Melee or ranged attack roll: 1d20 + attacker's ability modifier + attacker's proficiency bonus (if attacker is proficient with the weapon used) + any other modifier.

Some spells require the caster to make an attack roll to determine whether the spell effect hits the intended target.

Spell attack roll: 1d20 + spellcaster's spellcasting ability modifier + spellcaster's proficiency bonus.