How does the body compensate for metabolic acidosis?

There are many ways:

your kidney will hold on to bicarbonate

your kidney will get rid of ( H+) or excrete the extra hydrogen ions through peeing.