Taking a test ??

How long should you wait to take a pregnancy test ? And what test is the most accurate (aside from doctors visit)