How do I return money to the IRS that I am not entitled to? Do I wait to amend or send it as soon as possible?

I recently filed a form 1040, but I was supposed to file a form 1040-NR, I am waiting for 03/25/2021 to amend the return. My question is, since I received some money already from the IRS do I need to return the money as soon as possible or do I wait to return it together with correction? Since it was a direct deposit, what are my options to return it?

 

Any help would be greatly appriciated.