In the case of the Apollo missions, the solution was to minimize the second two factors. We can’t control the energy of those particles, though they can be large. The density of the Van Allen belts is well known (from sending uncrewed probes through them), and there are hotspots you can definitely avoid. In particular, the innermost belt is a rather tightly defined region, and it was possible to stay out of it for the trip to the Moon. The second belt is much larger, and harder to avoid, but there are still denser regions to avoid. For the Apollo trips, we wanted to send the astronauts through a sparse region of the belts, and to try and get through them quickly. This was necessary in any case; the crafts had to make it to the Moon in a reasonable amount of time, and the shorter the trip, the less exposure to all sorts of radiation the astronauts would get.
In the end, it seemed that these tactics worked; the on-board dose counters for the Apollo missions registered average radiation doses to
the skin of the astronauts of 0.38 rad. This is about the same
radiation dose as getting
two CT scans of your head, or half the dose of a single chest CT scan; not too bad, though not something you should do every week.