Is there a way to account for a payment made to the IRS when amending a return?

I received a letter from the IRS saying that I owe them money for 2018, so I paid them. I received another letter from the state of NY saying that, because I paid the IRS, I might have to pay them, too. I am amending my 2018 return and I found the error I made (It was with one of my 1099-R) and I wondering how I would account for the money I already sent to the IRS while doing the amendment.  

Thank You