How soon can I take a test?

It’s been two days since I had sex and he came inside. I have been on the IUD for a few months but I’m still worried of the odds of getting pregnant. How soon can I take a test?