I guess Samsung galaxy mobile is locked due to you have entered unlock key more then 5 to 10 times. And now your samsung galaxy mobile is freezed and hard locked.
Now to Unlock samsung galaxy mobile
you need unfreeze code and then sim unlock code or sim network unlock pin. You can generate unlock code from imei number of your mobile. it generate 4 codes. First is your sim unlock pin and last is defreeze code.
You can also try this alternate method for unlocking your galaxy mobile.
If you have rooted your mobile and want to unlock it without code then You need custom rom , bootloader unlock file and also flashing tool. And also download samsung driver from samsung site.
Now once mobile is rooted flash rom on it and unlock bootloader for samsung unlocking.
Instead of this you can also try this method to unlock your samsung mobile.
Enter into service mode of samsung mobile by following command *#27663368378# or *#0011#.
then choose debug screen then network lock then select parso sha256 off option. now once your mobile is rebooted it wan't ask unlock code. Howto network unlock samsung galaxy s7 edge