So underrated it pains me...
Cofagrigus is a proficient Ghost-type for teams that require a bulky, offensive spinblocker. Not only does it have a huge base 145 Defense, it also boasts an excellent ability in Mummy that can provide unique support to a team. With it, Cofagrigus can be used in clutch situations to neuter Pokemon that rely heavily on their abilities to be a threat, such as Azumarill, Scizor, Talonflame, and Mega Mawile. Furthermore, Cofagrigus is one of the best Trick Room setters and exploiters in OU, and with Ghost-type coverage being very strong, Cofagrigus is a challenging opponent to defeat, especially with its access to Nasty Plot to bolster its offensive presence.
Aside from that, Cofagrigus is outclassed by other Ghost-types such as Jellicent, Sableye, and Trevenant when it comes to fulfilling a defensive role. Its pitiful HP stat, mediocre special bulk, and lack of reliable recovery prevent Cofagrigus from frequently switching in against the opposition. Because of this, Cofagrigus heavily relies on Trick Room and Nasty Plot to do anything significant, making it a relatively one-dimensional and predictable Pokemon.
Trick Room Sweeper
name: Trick Room Sweeper
move 1: Trick Room
move 2: Nasty Plot
move 3: Shadow Ball
move 4: Will-O-Wisp / Hidden Power Fighting
evs: 248 HP / 8 Def / 252 SpA
ivs: 0 Spe
Trick Room enables Cofagrigus to bypass its pitiful Speed and provides its teammates with the Speed-altering effect as well. With Cofagrigus's natural bulk and good defensive typing, setting down Trick Room isn't a difficult matter, and it can find many opportunities to set up Nasty Plot when it's ready to sweep. Shadow Ball is an excellent STAB attack that has great coverage on its own now that most Steel-types don't resist it anymore. Will-O-Wisp is preferred in the last slot for the great support it provides, allowing Cofagrigus to cripple physical attackers such as Tyranitar, Excadrill, and Garchomp, thus further aiding it in setting up; it also punishes Sucker Punch users such as Bisharp and Mega Mawile attempting to revenge kill Cofagrigus. However, if you prefer coverage against Dark- and Normal-types such as Tyranitar and Chansey, then Hidden Power Fighting is an acceptable alternative.
252 HP EVs are used to give Cofagrigus much-needed overall bulk due to its low HP stat, and 252 Special Attack EVs are used for maximized sweeping power. The remaining EVs are put into Defense to take physical hits slightly better. A Quiet nature and 0 Speed IVs are used to make Cofagrigus as slow as possible to get full effect out of Trick Room, effectively outpacing nearly the whole metagame.
It's best to use Cofagrigus's support early- and mid-game by setting up Trick Room and burning opponents if you opt for it. Take advantage of its bulk by checking threats such as Scizor, Garchomp, Terrakion, and Lucario. Attempt to sweep later in the game when Cofagrigus's hard counters are weakened or eliminated. When boosting with Nasty Plot, do not get greedy with it, as one is often enough; boost further only if you are certain that boosting again will not break your sweep.
Specially defensive walls are going to be a nuisance with their status ailments and attacks, so it's best to use Pokemon that can handle the likes of Chanseyand Togekiss. Mega Mawile is great to look into, which further benefits from Trick Room support with its low Speed. Speaking of this, carrying Pokemon that can take advantage of Trick Room is also recommended, such as the previously mentioned Mega Mawile, Conkeldurr (which also deals with Blissey, packs a nice Dark-type resistance, and handily disposes of one of Cofagrigus's biggest checks, Tyranitar), and Choice Specs Sylveon. Finally, although not necessary, Cofagrigus appreciates teammates that can also set up Trick Room for itself to ease its setup; Porygon2 is one of the most consistent Trick Room users with its excellent bulk, immunity to Cofagrigus's Ghost-type weakness, and Trace.
Defensive sets with either Pain Split, Knock Off, or Haze are available, but are largely outclassed by the many other Ghost-types that have better typings, stats, and movepools, such as Jellicent and Trevenant. Cofagrigus also gets unique access to Toxic Spikes as a Ghost-type, being able to set them up and simultaneously prevent Rapid Spinners from removing them. Calm Mind is an option over Nasty Plot, but the greater Special Attack boost is far more beneficial than the boost in Special Defense, as Cofagrigus shouldn't be trying to set up against special attackers regardless and needs to minimize the number of turns it needs to set up and sweep.
Checks & Counters
**Specially Defensive Walls/Tanks**: Blissey, Togekiss, and Chansey are some prominent special walls that can cripple Cofagrigus with status, instantly reducing its effectiveness. Assault Vest Tyranitar, although susceptible to Will-O-Wisp, can also outlast Cofagrigus by constantly Pursuiting it. Assault Vest Conkeldurr is also a key threat, taking advantage of Will-O-Wisp with its Guts ability and hitting Cofagrigus hard with Knock Off; however, it needs to be switched in on a predicted Will-O-Wisp or be statused prior in order to KO Cofagrigus with Knock Off, otherwise Conkeldurr will lose its Guts ability after the first Knock Off due to Mummy and won't be able to finish Cofagrigus off if burned.
**Toxic Spikes**: Toxic Spikes instantly shuts Cofagrigus down when it comes to pulling off a sweep, as it will suffer far too much poison damage before it can even get the ball rolling, eventually succumbing to it. Forretress, Tentacruel, and Greninja are three prominent Toxic Spikes setters.
**Special Attackers**: Powerful special attackers such as Keldeo and Thundurus can be used to break through Cofagrigus's mediocre special bulk. They are capable of causing serious damage, which can prevent Cofagrigus from setting up both Nasty Plot and Trick Room.
**Dark- and Ghost-types**: These Pokemon can be used to check Cofagrigus before it can begin setting up. Life Orb Gengar, Choice Band Tyranitar, and Mega Absol (which can bounce back Will-O-Wisp due to its ability) are great choices to consider.