Passing the CPA exam - Register and then Study?

Hi I'm new to this and I was wondering which should I do first to pass the CPA exam. Should I buy review course to study then register for the exam or should i register for exam and study and prepare for the next exam? Thanks for your feedbacks!!