I like the Rug Doctor system, available in lots of grocery stores and diy stores. I saves me from buying and storing my own shampooer.
The rug doctor is great as suggested above if the whole things just needs a good deep clean.
For spot cleaning you can try this https://www.hometalk.com/3748611/the-very-best-trick-to-clean-stubborn-carpet-stains
For just refreshing the smell, try this https://familyfocusblog.com/diy-carpet-deodorizer/
Also, great for killing germs and deep cleaning is a steam cleaner if you could borrow one. https://familyfocusblog.com/home-steam-cleaner-dupray/
First, make sure you have vacuumed until you are sure you have picked up as much dirt as possible. Next, use a carpet cleaning machine. Renting one is one option, another is purchasing (if you think you will need it multiple times). I purchased one for under $100 and it came with a cleaning solution. Once I used all of that, I began to use vinegar and hot water to clean with a dash of blue Dawn. It works wonders and the smell fades in a couple of hours.
Here's a post that might help - https://www.realsimple.com/home-organizing/cleaning/cleaning-stain-removal/easy-carpet-stain-solutions
I do my disabled clients carpets for them, and they all swear I do a better job than steam vac.
I pre-treat all the spots with Dollar Tree Awesome Carpet spray. I swear by my Hoover SteamVac Surge Plus carpet and upholstry cleaning machine. I use Zep Professional Carpet Cleaning solution in the reservoir (red gallon). If you have pet stains and accidents, I use the cleaning tablets from either Jackson Galaxy or Fission, that I put in the water reservoir with warm water to get rid of the stains and odors.
When running a carpet cleaner, its best to not get the carpet too wet, best to run a sudsing run, then several passes to remove any water and dirty cleaning solution. After cleaning if there are still areas that didn't come clean, I use the Awesome Foam Carpet Cleaner from the Dollar Tree on the stains and high traffic areas that didn't come clean, I use a carpet brush on a long wooden handle to scrub it in. Then run the carpet cleaner over it to suck up the foam and dirt.
I then put fans on the floor to dry it out faster. Even the apartment manager has complimented me on my ability to get those old carpets looking fresh again.
If you don't already have a carpet shampooer, you can rent one from Walmart or most grocery stores. These are AMAZING to clean carpets or even a microfiber couch with! I would spray trouble areas with a stain remover and let it sit for a bit. Then fill the carpet shampooer with solution and water and get to work!
Hi Sharon, hope this helps you out, also remember once the carpet dries to put a coat of scotchguard over it to protect from future spills
If you do buy one (mine is a Bissell and I love it) make sure it has an upholstery attachment. I use that on stubborn spots, edges of the carpet, to lift pressed in spots on the carpet, mattress cleaning and upholstered furniture. I stick with good brands since a professional carpet cleaner told me using dish detergent in a DIY mixture actually attracts dirt. Read the label and go with the least chemicals you can. I do spot clean with white vinegar and baking soda, blotting as I go, and following up with a good cleaning with the rug cleaning machine. Always vacuum your carpet in both directions first, especially if you have pets. Good luck!