Start by going to the station of the Circumvesuviana, on the right of the Naples main station. Buy your ticket to Pompei Scavi (€3.20) there. After visiting Pompei/Ercolano, at the respective station buy your ticket to Ercolano (€2.20) and Napoli (2.50). Before boarding trains, stamp your tickets (valid 1 hour IIRC). Simplicissimo!
PS At the Circumvesuviana station you could ask whether they have full-day tickets, but I doubt as no such thing is mentioned anywhere.
PS2 Woe, both places in one day: get with you with some high energy food (e.g. chocolate bars), water and good, light shoes!!!