When is the best time to take a pregnancy test?

It's been a couple weeks since having unprotected sex... My period should have started on the second... So it's four days late... When's the best time to take a test? What should I do?