You are trying to interrupt a spell being cast by a creature. If the creature is casting a spell of 3rd level or lower, its spell fails without any effect. If the creature is casting a spell of 4th level or higher, you make an attribute check with the key attribute of the cast, and the check DC is equal to 10 + the level of the target spell. If the check succeeds, the target spell fails without any effect.

Counterspell 5e

Level: 3rd

Classes: Warlock, Sorcerer, Wizard

Casting Time: 1 Reaction

Range: 60 feet

Components: S

Duration: Instantaneous

When using a 4th-level or higher spell slot to cast this spell, if the level of the interrupted spell is not higher than the level of the spell slot you are using, the target spell will be interrupted directly.