Go to Settings and press Buildnumber 7 - 8 times quickly.
You may have to enter your Lockscreen method.
Press "OEM unlocking"
The Phone probaly will warn you and prompt to factory reset. Do so.
Login to a Google account and repeat step 1 and step 2
Power off your phone.
Press the following buttons. The Powerbutton should be the last
A Blue screen with text will come up. Press Powerbutton UP to continue.
A Screen similar to this should appear
Download ODIN (Samsung Flash Tool)
Download a Recovery.
Patched Recoverys (erofs support)
If you got an recovery.img, name it exactly that and compress it into a tar file.
Extract and open odin.exe
Put recovery.tar into AP and prepare:
prepare to press start and instantly press Vol up, Powerbutton and Bixby.
press start and press the keys.
If you want to keep stock, click on wipe, format data, enter "yes" and flash this