Is it the door latch on the door or the door lock on the machine that you want to replace?
Unplug the appliance and open the door.
Take the screws holding the door lock in place out.
Take the door seal retaining ring out.
(Pull the door seal and you'll see the groove close to the front panel, the retaining ring is in there and the spring is normally between 6 and 9 o'clock position).
Take the door seal off.
Reach in and bring the lock to the port hole.
Swap the wires to the new lock.
Fit the new lock in place.
Refit the door seal and refit the retaining ring.
Hope this helps
Let me know how it goes or if you need more help