Remove the trap from beneath your sink if it doesn't have an additional waste inlet. You should be able to unscrew the connectors that secure your trap to the base of your sink and your waste pipe with your hands. Use a wrench if the connectors are stubborn. You may want to lay some old towels over the area below your sink to catch any residual water before you start.
Screw your new trap into place beneath your sink.
Run a bead of silicone sealant around the joints between your trap and the base of your sink and your waste pipe.
Connect a drain pipe extension to your machine's waste outlet if it doesn't reach your sink trap. Use a hose clamp to secure it into place. Some washing machine manufacturers sell machine's with very short drain hoses to save on production costs.
Connect the other end of your drain hose to the waste inlet on your sink trap by pushing it firmly into place. Secure the connection with a hose clamp.