Car insurance first? car first? what to do?

Going to buy my first car new off the lot. Do I Buy the car first and drive it off the lot ILLEGALLY and then get insurance? OR can i get Car insurance without a car and then buy the car? How does this work if I am not insured and don't have a car?