I can add from experience working a car lot as a late teenager, if we chose to sell a trade-in that had horrible carpet, I was the lot kid who did it:
I'd pull the carpet, lay it flat on concrete & use a weed sprayer with Simple Green mixed in it (choose your own ratio / nastiness of carpet) - I'd spray solution & let sit 15-20 mins.
Then I'd add some hose water to a certain spot, working a 2' square area at a time, working from the highest part of the carpet as it laid on ground to the low spot / drain.
I used a brush that you get for wheel cleaning, the 2" bristle with a 3" square head, and I'd add car wash soap direct to spots I worked to lift out the dirt.
Once I'd worked over the whole carpet I would use the hose nozzle to power the grit from the high to the low again, litterally hitting every square inch along the way.
Then I'd make the same pass wearing safety glasses while using compressed air, the glasses saved eyeballs from flying grit (you'll be surprised) & using the rubber tipped handnozzle, the brass venturi type just spit air side to side.
The air helps, but it'll still be 2 days hanging before it's dry enough to reinstall, but it weighs little enough my scrawny 17-18 yo self managed to heave it over a makeshift clothesline I'd make.
One point I can add is the compressed air really lets some serious crap loose that you find ground in especially in the driver footwell where the heel pivots from gas>brake, it helps re-fluff the carpet & dries the carpet more than using a shop vac while spitting that fine sand loose the shop vac won't grab either.
The garden hose with a good nozzle & the compressed air to help fluff / dry carpet were the best ways I found to loosen / get rid of grit you otherwise don't get out.
HTH somebody.