Plumbing in the walls rattle when a washer is filling because the flow is controlled by the fill valves which are solenoids that snap open and snap closed. This creates a situation in your pipes called "water slam or hammer". This can be cured by the methods described here:
Plumbing in the walls rattle when a washer is filling because the flow is controlled by the fill valves which are solenoids that snap open and snap closed. This creates a situation in your pipes called "water slam or hammer". This can be cured by the methods described here:
Simplest solution would be an arrestor here:
https://tinyurl.com/4rx4548n
There are others:
https://www.amazon.com/water-hammer-arrestor/s?k=water+hammer+arrestor