How soon can I take a pregnancy test?

I’m a little worried because I had unprotected sex on the 8th and he came inside me. I was not in my fertile window at the time but it was about 4 days before. I didn’t take plan b or anything at all so it was completely unprotected. Very stupid of me and this worry has definitely made me learn my lesson and I will be getting birth control in the new year!!