How exactly is this accomplished? I mean, in theory travel to Cuba was banned for a long time, but it was easy enough for Americans to travel to Cuba by hopping over to Canada or the Dominican Republic first. Somehow I doubt there are direct flights to Pyongyang available currently that could be cancelled. How do you prevent Americans from traveling to North Korea through other countries (China, South Korea, etc.)?
You can't stop them. You can only impose penalties on those who are caught doing it. The State Department can unendorse all ordinary US passports for travel to North Korea, but it is up to North Korea whether it wants to admit them or not, although you need a visa to visit, which makes it different from Cuba.
It will be up to tour operators and airlines to prevent Americans from entering North Korean soil. You can't just get a North Korean visa by applying at the Embassy, you need to be sponsored by a North Korean organization such as a state-owned business or university, or go on an organized tour.