Dispel magic 5e instantly ends any spell on a target creature, object, or magical effect of 3rd level or lower. For spells of 4th level or higher, you must make an ability check with a DC equal to 10 + the spell’s level. To do so, roll a d20 and add your spellcasting ability modifier; if it meets or exceeds the DC, Dispel Magic successfully dispels the spell (PHB 194).
Dispel Magic can also dispel multiple spells affecting an object or creature, however, a check will need to be made for each individual spell of 4th level or higher. It will automatically dispel all 3rd level or lower spells affecting an object or creature.
You can also upcast Dispel Magic — for each slot level above the 3rd, you can automatically dispel a spell of equal level. For example, upcasting Dispel Magic using a 5th-level spell slot will automatically dispel all spells of 5th level or lower; upcasting using a 6th-level slot automatically ends 6th-level spells or lower, etc.
How does Dispel Magic Work?
The spell Dispel Magic works differently compared to most spells in the game. Its purpose is to remove magical effects on a creature, object, or area. To determine if it is successful when cast, the caster makes a contested roll versus the spell to be removed.
The caster adds their spellcasting ability modifier to the roll, and the difficulty class (DC) is determined by the level of the spell to be removed.