The nearest airport is Naples, which is about 90 minutes away by car, and Rome is around 5 hours away.
If you do not rent a car, there are some public transport options. Both Naples and Rome have train departures for the town of Salerno, which is just east of your final destination. Then, once in Salerno, there a few ways to complete the last part of your journey:
Take the 5120 SITA bus to Amalfi (departs about every 3 hours from the square outside the Salerno train station and takes about 1hr and 15 mins). If your destination is Positano, you can then either take the ferry or the bus.