If you go by train it’s easier to take the train all the way to Salerno, then the bus or boat to Amalfi. The Salerno train station is in front of the harbor.
If you get off in Naples, then you need a commuter train to Sorrento, then a bus to Amalfi. Amalfi is somewhere between Naples and Salerno, but closer to Salerno.
Having said that, I would drive all the way as I posted earlier. The road is freeway, like in America. The last portion of the road, after exiting the freeway, near Amalfi on the Amalfi Coast, is curvy, but if you know how to turn a wheel, it’s not a problem. Check the street view feature of Google Maps to see it.
You can keep the car for your entire stay and return it to NAP Airport. However check if your accommodations has parking (few do). If not the parking lots in Amalfi charge about 25€ a day.