The US states, not the national government, handle vehicles.
So, there are 51 different processes (one for each US state, plus Washington, D.C.) for buying, registering, and insuring a vehicle in the US.
The set of steps that apply usually depends on the US state where the buyer lives.
But as an international visitor, you don't live in any US state.
So your first step is creating a presence in a US state.
Create a presence in a US state
In order to own a vehicle in any US state, you need a presence in that state.
Each US state has its own rules for the presence required to own a vehicle. These range from a simple address requirement to proof of residency (such as a utility bill) to a driver's license issued by that state.
Buy Your Vehicle
Vehicle ownership cannot be transferred online in the United States.
The seller must provide the vehicle's physical Prior Title, the vehicle's ownership document, to the seller. The Prior Title must be properly signed, and free from liens and defects.
The buyer must provide payment for the vehicle, and payment and Prior Title exchange must be coordinated to protect both the buyer and seller.
Because the US banking system doesn't link very well with the international banking system, international visitors must plan ahead for funds transfers.
Register Your Vehicle
(In some states, you must register your vehicle in the county of the state of your US presence.)
First-time vehicle registrations must always be done in person, so you must bring your vehicle's Prior Title to the relevant DMV, along with the other documentation required.
Insure Your Vehicle
It's a good idea to learn the basics of auto insurance in the US, so you understand what you're buying.