Hi
If you're not sure how much you can afford, getting pre-approved is one of the best ways to determine your spending cap. For that reason (and because in my experience, pre-approval is essential to having your offer considered), it's an important step I encourage you to take before you get too far into your home search.
That being said, your pre-approval will typically expire within 90 days, so if you're in the "casually browsing" stage, it might be best to hold off on getting pre-approved for now. It's usually a pretty quick process. It involves filling out a short application with a lender, who will then conduct an analysis of your financial situation and provide you with a letter stating the amount of your approved home loan.
Let me know if you have any questions, and if you're ready to start the process, I can refer you to some mortgage lenders.