When your washer enters the spin cycle, the motor speeds up. If the loud sound you are hearing is high pitched and resembles a jet engine noise, this is normal. This type of motor whine noise is made because of the motor speeding up quickly and then winding down when done. Nothing can be done about the volume of this noise since it is normal.
If the washer is making a loud vibrating or rattling noise when spinning, it may be because it is not sitting level. The force of the spinning motor can rock it from side to side or make it vibrate when it is not level. You can easily determine if the machine is level by pushing on its corners to see if it rocks in place. If so, the legs on the washer can be adjusted with a wrench to level it. You may need someone to help you lift up the front or back of the washer to access the legs.
If the loud sound you are hearing is closer to a banging sound, it may be a result of overloading the washer. You can prevent this by putting less laundry in the machine. If the machine is already running, you can stop the washer and remove some of the items.
When the washer is out of balance, you can encounter a thumping sound during the spin cycle. This happens when most of the laundry ends up on one side of the washer tub, which often happens when you are washing blankets or other heavy items. You can stop the noise by stopping the washer and redistributing the laundry. In the case of a blanket or something similar, the laundry may have tangled into a ball or knot that you have to undo.