Hazards are definitely difficult to keep up in some games. Unfortunately, there is no clear cut answer as to how to keep them up. The best ways definitely include what you've said and:
- Try to knock out the hazard remover before setting them up. But if the hazard setter can beat the remover, set them up to lure something out.
- Even if your setter doesn't beat their remover, it can be immensely helpful in some games. Look at your opponent's team. Does (s)he have a mon that is 4x weak to rocks, or multiple mons 2x weak to rock? If so, I would throw them up as early as possible, even if the remover can come in, because it allows your threats to also come in and throw off big hits as they defog/rapid spin.
- There is very little drawback in setting hazards up early, especially stealth rock since hits everything for some damage. Spikes and such can be more tricky since they only affect grounded mons. Take into account if you're trying to set up Spikes and Toxic Spikes, note it is much more difficult when dealing with defoggers like Mandibuzz.
If you still struggle with hazard removers, I would definitely recommend fast/priority Ghost type Pokemon to block hazard removal. Ghost types are immune to rapid spin, and many ghosts learn Taunt to prevent defog. A few I would suggest:
- Sableye or Mega Banette, prankster taunt users and immunity to rapid spin. Also gives a good defensive or offensive mega slot respectively if you need one. Sableye's dark type also resists Mandibuzz's Foul Play and is immune to the Latis Psyshock/Psychic (watch out for Draco Meteor though).
- Suicide lead Froslass is also common. Froslass learns Taunt, Thunder Wave, and Spikes. Thanks to its Hidden Ability, cursed body, it also has a 30% chance to disable the last connecting move by the opponent, the same chance as Scald has to burn.
- I've also seen Spiritomb on occasion. It works okay as an assault vest user and has access to Will-O-Wisp, and priority in Shadow Sneak/Sucker Punch. Spiritomb can provide a little bit more offensive pressure compared to things like Sableye in my opinion.
Hope this helps! :)