How does one test a website prior to release?

Basically i'm wondering what the best way is to test a website before deployment. I would essentially want to test each iteration thoroughly before making the site live but am not sure the best way to go about doing that. Thanks