I complained bitterly about these when they were added. They still make ZERO sense to me (zombies are too stupid to open doors, but they can activate grenade-bots?!?), but I have accepted that they will exist.
Until you are a very good shot and have enough ammo, you just plain stay away from them. Full Stop. That goes quintuple for the ELITE grenadiers - they have a lot more hacks AND one mini-nuke hack (which they can drop active on death, actually, if they haven’t used it yet).
(If you find one in a lab, you can open the door, get it to release a hack, then close the door. Lather-rinse-repeat until they kill themselves.)
Once you have a way of shooting down the hacks before they kill you, you can just hang out, killing hacks until the grenadier goes from “tracking” to “hostile”, which means it’s out of hacks… then, when you kill it, it drops no active hacks.
Also, once a grenadier has “died” once (doing the “drop some active hacks” thing), it is out of hacks, so if you have a way of killing it (like staying in the general vicinity while it kills itself walking on wreckage, for instance), but you don’t manage to pulp the corpse, that’s ok - it’s basically a glorified normal zombie when you come back.