How can I stop my mudguards from rattling?
I think it's a problem that must be solved on a one-off basis, since there so many different fender/bike combinations.

First make sure the connections are really tight.  Often they work loose over time.  Then try to observe what's rattling.  Some heavy tape applied to points that tend to knock against the bike frame may help.  Different fenders that are stiffer and have more stays is another possibility.  In some cases you may simply want to cut off, eg, part of the front fender extending forward from the fork, as that area tends to be less well secured and vibrates quite a bit.  (Mine cracked at the fork and the front part fell off some years back, and I haven't missed it.)