I know this is something that has happened to a lot of us, purchasing the wrong color foundation. Eyeballing or doing a small swatch of foundation before purchasing doesn't always work. I purchased the wrong liquid foundation color on two separate occasions, one was too dark and the other too light. I like both because they give me different coverage so I use these tricks to make them work.
If you purchased a liquid foundation that is too dark you can mix it with either a little bit of moisturizer, a lighter foundation/concealer or even sunscreen if you would like a little protection and a dewy finish.
If you accidentally went with a liquid foundation that looks too light try mixing it with either a darker foundation if you have one or after you have applied it set it lightly with a matte bronzer.
Mineral/Loose powder foundation:
Same goes for loose powder. If it's too dark try mixing it with a lighter powder. If it's too dark mix a small amount with one of your bronzers.
I use this trick with my liquid foundation. I have really dry skin so powder foundation doesn't work well for me, if you try this trick with your loose powder I would love to know if it worked for you or not.