When buying a used car, what is the process of getting insurance for it?

I live in Indiana, but am about to buy a used car that is in New York. I am going out there to pick it up and drive it back to Indiana. How do I go about insuring and licensing the car? This is my first experience with this. Do I need car insurance before I leave New York, or do I get that once I get it back to my home state and get it licensed and tagged? How long do I have before it needs to be insured? How long do I have before I need to get plates and everything for it?

Where can I search on the internet to find more information about this, also? Thank you.