A trap’s description specifies the checks and DCs needed to detect it, disable it, or both. A character actively looking for a trap can attempt a
Wisdom (Perception) check against the trap’s DC. You can also compare the DC to detect the trap with each character’s passive
Wisdom (Perception) score to determine whether anyone in the party notices the trap in passing. If the
Adventurers detect a trap before triggering it, they might be able to
Disarm it, either permanently or long enough to move past it. You might call for an
Intelligence (Investigation) check for a character to deduce what needs to be done, followed by a
Dexterity check using thieves’ tools to perform the necessary sabotage.