The Circumvesuviana has a PDF schedule, but is not as well run a company as Trenitalia. It does not sell tickets online, but does at newsstands and a handful of physical stations, like in Naples. It is more like urban transit than, even, regional commuting. It tends to be hot and crowded. It is unquestionably a cheap and reasonably reliable way to get from the Naples train station to Pompeii Scavi. There have been reports here of omitted Circumvesuviana runs, and late trains, but that happens even in Germany (especially today.) There is a fixed-rate taxi sheet for Naples, so you can see what your last-ditch backup cost could be. Of course, the printed Circumvesuviana schedule will allow you to learn how long the actual trip is, so you know when to go upstairs and hail a taxi.
I do not mean to create worry or doubt, I'm just trying to respond to a reasonable question about mass transit in a section of Italy with poor infrastructure investment. When you don't have your SUV, you have to deal with public transportation.
The Circumvesuviana stops at the highest-traffic entrance to Pompeii Scavi, called the Porta Marina entrance, which is only steps from the train station.
https://community.ricksteves.com/travel-forum/italy/pompeii-day-trip-from-rome-2c38f926-9036-480d-95fd-403dd7694e4a