I inadvertantly paid both state and federal 2018 taxes twice(E-Paid both and also wrote a check for both. How do I get a refund for the double payments?

The double payments to IRS and NY were accepted by IRS and NYS..