When this situation occurs, you have two possibilities:
-
Visit Samsung Center or a local phone service shop. They are able to connect the phone through a hardware box to manually remove the password from the memory.
-
Attempt a factory reset (!!! you will lose installed apps and custom settings !!!) using Volume UP + Volume Down + Home + Power key. Turn off the phone, press these buttons until you get into Recover manager. Use volume buttons to select Wipe Data/Factory reset and reboot the phone.