The Frigidaire Affinity is a well-made clothes washer but even it can break over time. The lock on the washer has three parts, any of which can malfunction. There is the striker plate on the door itself which can crack or get jammed. There is the door latch which can fracture or get jammed. Finally there is the door pressure sensor that detects when the door is closed which can prevent the lock from locking if it does not detect the closure of the door.
Turn the washer off. You do not need to unplug the washer as you will not be dealing with electrical components. Take out any clothes from the washer to give you extra room while working on the washer.
Examine the striker plate on the door. The plate is located on the outside rim of the door where it impacts the door latch on the front of the washer. Push the plate to see if it wiggles or moves. If it moves then it may be preventing the striker from engaging the door latch. Fasten the two screws holding it down tightly, but only with hand tools as power tools may crack the Plexiglass on the door. If the striker fractures or has snapped off, then unfasten the screws and replace the striker with a replacement part.
Examine the door latch on the front of the washer. It will be located where the striker would rest if the door was closed. Unscrew the panel on the latch; it will be secured with one Phillips screw on the top of the panel. Pull the panel off and examine the inside of the latch mechanism. Pull out any lint or debris with a pair of needle nose pliers. Rescrew the panel back onto the latch once you are done.
Examine the pressure sensor that is located six inches above the door latch. It will be a plastic nub that moves down when the door is shut, telling the washer it can now wash clothes. Push the button down to see if it will fully recoil. If it stops before fully going back, then unscrew the plate that surrounds it. There is a single Phillips screw to the right; unscrew it and pull it off. Use a pair of needle-nose pliers to pull out whatever is stopping the nub from going fully back in. Screw the plate on and close the door.