how do you intall a door latch/lock?

I just bought a replacement for my door latch/lock for my duet washer. my washer was displaying an error message of F dL. i could hear it trying to lock numerous times, but it was never locking and starting. How do i install this part?

thanks!