How does one get gasoline in 2050? One uses ethanol. Just open the flap cap on your gas tank and pour in the juice, the same as always, except now it’s from bottles instead of a pump, most likely.
Ethanol is broadly similar in combustion properties to gasoline. It’s not as energetic as a direct gasoline replacement but it will work. It does, however, have a higher octane value than gasoline (read: can be compressed more before auto-igniting) which means with a specialty tune it could be a pretty close match in terms of energy profile. (cf: Koenigsegg Jesko which makes significantly more power on E85 gasoline than it does on plain gas.)
You may need to find a conversion kit to ensure your car is fully capable of burning pure ethanol. Very modern engines would have little to no difficulty, possibly just a rechip. Older engines would require more work–changing up hoses, adjusting sensors, and so forth. Carbureted engines might be challenging, and they’re beyond my knowledge.
Performance specialists may offer engine rebuilds to get the most out of the juice you’re burning–upping your engine compression, fiddling with the combustion timing and so forth.
So I think that, frankly, you could keep enjoying your gasoline engine, but there would likely be many fewer places to fuel up. One of the major drivers of ethanol production is gasoline, ironically, for urban-use E10 blend. With that gone, the price of industrial-grade ethanol is likely to go up.
(If you’re hard-pressed, you can make your own fuel, and a small-scale distillery would be the way to go.)
Anyway, in short, I don’t think the fuel will be the hard part in the future. The lubricants and replacement parts, that’s what will get you. Only specialty manufacturers will be making synthetic motor oil, and while it will be of very high quality, it will be shockingly expensive. Most parts simply won’t be made for your cheaper cars. I’d bet you’d find replacement parts for a 1998 Supra long after they’ve run out of piston rings for a Kia.