How do you prevent nuclear accidents?

Three main routes: 1. Good design. The overall concept has to be well thought out, and big decisions like secondary containment decided on. Then it is a matter of working out all possible failure sequences, and showing that major accidents are reduced to a probability of less than 10-6 per annum. This analysis relies on a multitude of assessments of, for example, properties of materials and how they behave in possible conditions in the plant, especially in the primary circuit. Stress analysis is very important and must take account of thermal cycles and vibration levels. Also the behaviour of materials in possible chemical conditions. The possible earthquake levels in the locality need to be assessed and applied to the design to find any weak points. The control and instrumentation must be assessed for the required functions and made reliable enough. And so on, you get the idea I expect.
2. Construction: it is very important to make sure the plant is actually built to the required specification, the correct materials used, and techniques such as welding must be fully inspected and recorded.
3. Operation. The operators must be well trained and supervised, and have the correct operating manuals, and have had training in what to do in unusual conditions. The owners should also have a team of head office engineers who can continuously assess that the plant is being run correctly, and analyse for any improvements to be made in the plant.

The above all applies to the owners and builders. In addition there must be an independent body who give the licence to operate and regularly examine the plant and operations for compliance. This is the NRC in the US and the NII in the UK, but all countries must have such a body.