Incorrect Refund

I filed an extension while awaiting a K-1 and pre-paid $500 towards federal Federal taxes. Once I receive the K-1, I finalized and submitted my tax return And $178 was charged on my credit card for the balance on federal taxes and also withheld from my state tax as a federal tax payment.  How do I  prevent being charged twice for federal taxes ?