Check the wash load
Often a washer can start vibrating in a disturbing fashion simply because the wash load has become seriously unbalanced. Open the lid of your top-loading washer to inspect the load. If all the clothes are clinging to each other on one side of the spin basket, pull them apart and redistribute the load. Stand by the washer as you restart the cycle to see if that solves the noise and vibration problem.
Check the shock absorber
If you still hear knocking noises after redistributing the wash load, you may be experiencing a problem with the machine's shock absorbers. The shock absorbers maintain the wash tub's stability and are among the washer parts that allow the tub to spin and agitate without causing damage to the rest of the appliance. If you discover a failed shock absorber, replace it.
Tighten or replace the spin basket
Sometimes the inner spin basket in a washer can become loose and create a lot of noise. Often tightening the spanner nut is all that's needed to restore the spin basket to its proper position. If the spin basket has become damaged while knocking around loose, it should be replaced.