Freaking Out and Need Help!!

My boyfriend and I had sex two nights ago. I’ve been processing everything that happened and the condom ripped. It didn’t rip while we were in the middle of it but I don’t know what I should do. Should i take a pregnancy test? When do I take the test? Any advice is well appreciated.