If your neighbor's washing machine is keeping you up at night, then it is best to start by having a calm conversation with them and explaining the problem. Most issues can be resolved with a quick conversation, it may be that they don’t realize you can hear their machine. If this doesn't work, consider contacting your HOA for assistance, a building manager for apartments, or look up local noise enforcement agencies.
It is best to keep a positive relationship with your neighbors where possible, so try to resolve the noise issue peacefully.