The F2 error code indicates a long drain in the washer. This is likely the reason that the door is locked and will not unlock. The central control unit of the washer detects that the washer is full of water and will not drain. If the washer is empty and does not have water in it, then you could have a defective water level pressure switch. A stuck contact in this switch could be causing your problem. If this describes your problem, you can sometimes correct this type of problem by tapping on the pressure switch with the handle of a screwdriver to free up the stuck contact. To access the pressure switch,
unplug the washer
and remove the top panel. Three screws on the very back of this panel secure it to the washer cabinet. Remove these screws and pull the top panel back and then up and off of the washer. Tap on the pressure switch (Key 38 in the image below) with the handle of a screw driver and then reassemble and test the washer. If the washer still displays the F2, then you will likely need to replace the pressure switch.
If the washer is still full of water and will not pump out, then you could have a clog in the drain hose or the drain pump. Check your drain hose for kinks or clogs. If you suspect that the drain pump is clogged, then you can use the procedure in the following link of a previous answer to access and clear the drain pump:
How to access the drain pump on my He4t washer?
To manually unlock the washer (with it still unplugged), you can carefully reach up and pull the release tab on the bottom of the door lock assembly with the bottom front service panel removed according to the link noted above regarding the access to the drain pump.
If you need more help with this problem, resubmit your question with additional details.