Swinging Boom, How do you stop it????
If this happened while you were attempting to change course the previous answers are the ones you need. If this happened while you were trying to maintain a downwind course you need a preventer. This is a line or tackle attached to the boom and your toe rail. This will prevent an accidental gybe caused by the helmsman or a wave rolling the boat.