Spironolactone is a drug that mainly functions in the kidneys as a diuretic that spares potassium by preventing aldosterone from doing its job.