I'll explain for OU, as that's the tier that Trick Room is most viable in. The most reliable way to play Trick Room is with a suicide lead, two setters, two abusers, and Melmetal.
Suicide Lead
For a suicide lead, you're looking for a Pokemon with Trick Room and a way to generate momentum. Two good suicide leads that I often use are Uxie and Hatterene. Hatterene is a great Trick Room setter due to it's ability, Magic Bounce, deterring hazards and Taunt. On the other hand, Uxie can set Stealth Rocks and use Memento to weaken the opponent.
Uxie:
Uxie @ Mental Herb
Ability: Levitate
EVs: 252 HP / 4 Def / 252 SpD
Sassy Nature
IVs: 0 Atk / 0 Spe
- Trick Room
- Stealth Rock
- Memento
- Magic Coat
Mental Herb is the optimal item on Uxie, as it has no attacking moves. You should set up Stealth Rock before setting Trick Room to maximize the remaining turns for the abusers. Magic Coat can bounce back a predicted Taunt after Mental Herb is consumed, as well as a form of anti-hazard. Memento is used instead of U-turn to bring in the abusers safely.
Hatterene:
Hatterene (F) @ Focus Sash
Ability: Magic Bounce
EVs: 252 HP / 252 SpA / 4 SpD
Quiet Nature
IVs: 0 Atk / 0 Spe
- Trick Room
- Psyshock
- Mystical Fire
- Misty Explosion
You can switch the item on Hatterene to something else if you'd like too, as it stays on the field for about two turns at most. A great alternative to Misty Explosion is Healing Wish, which still generates momentum and stores a free heal for the next damaged Pokemon to switch in. You can try running a Relaxed nature to always live a Surging Strikes from Urshifu-R with a Choice Band, but the extra explosion power is usually worth it.
Setters
What you're looking for in a Trick Room setter is bulk and a good pivoting move. Two Pokemon that fit the bill are Porygon2 and Cresselia. Both of them sport great bulk and a pivoting move in Teleport and Lunar Dance respectively.
Porygon2:
Porygon2 @ Eviolite
Ability: Trace
EVs: 252 HP / 252 Def / 4 SpA
Relaxed Nature
IVs: 0 Atk / 0 Spe
- Trick Room
- Ice Beam
- Toxic
- Teleport
Eviolite bolsters Porygon2's already good bulk, letting it live many more hits. Ice Beam KO's or chunks Landorus and Garchomp, but Tri Attack can be run instead. Toxic is great for putting defensive Pokemon on a timer, reducing how long they can stall out your team. Teleport provides some much needed momentum, letting in the abusers safely.
Cresselia:
Cresselia (F) @ Leftovers
Ability: Levitate
EVs: 252 HP / 4 SpA / 252 SpD
Sassy Nature
IVs: 0 Atk / 0 Spe
- Trick Room
- Moonlight
- Moonblast
- Lunar Dance
Leftovers provides passive recovery for Cresselia, but other options like Mental Herb are also useful. Lunar Dance fully heals the next damaged Pokemon to switch in, which is great for giving your abusers more longevity. Options like Psyshock and Ice Beam are other options to use instead of Moonblast.
Abusers
A good abuser has low speed paired with high bulk or attacking stats. Some notable Pokemon that fit these requirements are Conkeldurr, Alolan Marowak, and Crawdaunt. All of these Pokemon have great attacking stats as well as pretty good abilities.
Conkeldurr:
Conkeldurr @ Flame Orb
Ability: Guts
EVs: 252 HP / 252 Atk / 4 SpD
Brave Nature
IVs: 0 Spe
- Drain Punch
- Facade
- Knock Off
- Mach Punch
Conkeldurr is a powerful Guts sweeper with dangerously high attack. Drain Punch can offset the residual damage from Flame Orb, increasing how long it can remain on the field. Facade is great nuetral coverage with a boost from Guts, and Mach Punch is great priority. Knock Off is a way to deal with Ghost types.
Alolan Marowak:
Marowak-Alola @ Thick Club
Ability: Rock Head
EVs: 252 HP / 252 Atk / 4 SpD
Brave Nature
IVs: 0 Spe
- Swords Dance
- Flare Blitz
- Poltergeist
- Earthquake
Thick Club acts as a free Swords Dance, making it better than other offensive items like Life Orb or Choice Band. Flare Blitz is strong STAB that takes advantage of Poltergeist. You can use Bonemerang in place of Earthquake to break Substitute and Focus Sash, but Earthquake is much more reliable. A lower power albeit more accurate option is Shadow Bone, which can be used in place of Swords Dance for more reliable Ghost STAB.
Crawdaunt:
Crawdaunt @ Life Orb
Ability: Adaptability
EVs: 252 HP / 252 Atk / 4 SpD
Brave Nature
IVs: 0 Spe
- Swords Dance
- Aqua Jet
- Knock Off
- Crabhammer
Crawdaunt is another Swords Dance sweeper with a strong ability, Adaptability, which raises the power of it's STABs to incredible levels. Aqua Jet can be used to finish off low health Pokemon inside and outside of Trick Room, while Knock Off and Crabhammer serve as powerful STAB.
Melmetal
Melmetal is a must on any Trick Room team, so good that it needs it's own section. Banded Double Iron Bash does incredible damage to any offensive Pokemon, while still dealing a large chunk to walls and resists.
Melmetal @ Choice Band
Ability: Iron Fist
EVs: 252 HP / 252 Atk / 4 SpD
Brave Nature
IVs: 0 Spe
- Double Iron Bash
- Earthquake
- Superpower
- Thunder Punch
Banded Melmetal under Trick Room is a menace, and claims a kill (sorry, faint) almost every time it enters the battlefield. Earthquake is great for the likes of Toxapex and Heatran, while Superpower hits Ferrothorn. Thunder Punch is for Flying types like Corviknight.
Sample
Pokepaste
This is the team I use most often, and is assembled with the Pokemon shown above. It features Hatterene as the suicide lead, Porygon2 and Cresselia as the setters, Alolan Marowak and Crawdaunt as the abusers, and, of course, Melmetal.