As Helpful NPC Ryan noted, there's a methodology to making traps a part of your roleplaying game. Sadly, I wail and lament that good traps have fallen out of style in modernity. If your game is about courtly intrigue, politicking, romance, or anything but pillaging monstrous lairs for their treasure, that's probably a positive development. For the games I like to run, it's not so positive.
Historically, D&D has offered little guidance on implementing traps. In older editions, there aren't skills checks to notice things, so the players must locate traps by poking and prodding at the environment. Initially entertaining, this grows stale as players adopt convoluted procedures to detect traps. ("We're engaging Dungeon Delving Protocol A59: fetch the rope, pole, and flask of oil. Move into formation Delta!") The game progresses by inches as players pit their wits against the GM's fiendish devices. Roleplaying takes a backseat to out-of-character reasoning and adversarial play. Whilst Tomb of Horrors is a part of D&D's rich history, it retains infamy for a good reason.
In contrast to this playstile, modern D&D treats traps as an afterthought, an uninteresting two part skill check: roll to notice the trap, roll to disarm the trap. Traps function as a resource tax, a speedbump on the way to more interesting things. Roll your Perception and hope you beat a 13 so that you can then roll your Thieves' Tools proficiency and beat a 15 so you don't have to roll your Dexterity saving throw and beat a 12. Yawn.
Fortunately, Helpful NPC Thom is here to tell you how to do better.
Consider the sequence from Indiana Jones and the Raiders of the Lost Ark. Why is this trap good? It's incentivized: there's a clear lure to attract his attention. It's telegraphed: we all know there's danger present, and that makes the scene better. It's interactive: Indiana Jones attempts to "disarm" the trap by doing more than making a Dexterity (Thieves' Tools) check. It's multipart: the trap triggering isn't merely a resource sink, it affects the entire "dungeon," and Indiana Jones thus ends up exposed to more traps on the way out.
How would I design this in D&D?
The Golden Idol (DC 13)
Description: A crudely-sculpted golden figurine rests upon a pedestal. It grimaces with birth pangs, a golden head atop shrunken feminine form. It kneels upon a smaller central platform, arms clasped behind it.
Trigger: Removing the idol from the pressure-sensitive central platform.
Tells: A groove along the bottom of the smaller central platform reveals the idol rests upon a pressure plate.
Disarm: The trap can be "fooled" by quickly swapping out the idol for an item of equal weight.
Danger: The temple begins to collapse, dropping rocks that do 2d6 bludgeoning damage to anyone within 15 ft. of the pedestal. A Dexterity saving throw negates this damage. Once the trap is triggered, the temple begins collapsing. In 10 rounds, anyone remaining within is crushed beneath rubble.
Let's dissect this a bit. First, there's the trap name, obviously: the Golden Idol. Next to it is the trap's Difficulty Class. This is the relative difficulty for all checks related to the trap: checks to notice the trap, checks to disarm the trap, saving throws related to the trap. It's just that easy.
Next is the Trigger. Pretty self-explanatory. If the trigger condition is met, the trap's Danger occurs.
The Tell is how the players know there's danger afoot. This is an Intelligence (Investigate) check. (Perception and Wisdom get enough mileage as-is.) This check always occurs, even when the players aren't looking for it, because there's the off chance that they might notice the trap (treat it like a saving throw). The GM should apply advantage and disadvantage liberally based on the caution level of players. (If Indy waltzed straight up to the very-obviously-trapped-golden-idol and went to snatch it away, he's getting disadvantage.) If the players do something pretty clever, like pouring a bit of water on the pedestal and seeing it filters down into the groove, they automatically detect the Tell.
Disarm: this is the way to disarm the trap. Sorry, there's no thieves' tools proficiency check here...unless there's something that those thieves' tools could reasonably do to disarm the trap. As always, GMs should apply advantage or disadvantage on the check based on what the players do. If they half-ass it and toss on a bag of sand (sorry, Indy!), they get disadvantage. If they diagram up the head and calculate an approximate weight based on an equal number of gold coins and then fill the bag up with sand, they get advantage.
Danger is another self-explanatory section.
There's the basics of making a good trap. Stay tuned for more!