How do I switch carriers and buy a new phone?

I'm looking to buy a new iPhone. I also want to switch carriers. I have never bought a phone myself before and am still on my parents plan but I want to get off of it. I need to switch to a different carrier and I'm just curious how that works while buying a new phone? Do I sign up for the phone plan first or do I get the phone first?

Added (1). I didn't mention that I want to purchase the phone at the Apple store as well. I'm also on the plan that is with the company that my dad owns. From what I have read, it looks like I can sign up for a new plan and then get the new phone and then put the new SIM card in the new phone. I also plan on trading the phone with my old phone. After I get the new SIM card into the new phone, I will cancel my old phone plan. I just want to make sure I get everything right and don't mess anything up.

Go to a store operated by the carrier you want to use
and tell them you want an iPhone.

I just don't get it, people.
Almost everyone under 20 can barely wipe their own but without help these days.
Someone should teach them what life was like on a remote farm in the 1850s.
Maybe then…

Or maybe not.

Call them up