Hey there Amar_3456,
Thanks for reaching out to the Apple Support Communities. If you're unable to unlock your iPhone due to a forgotten passcode, the best option would be to restore the device using a computer with the steps below: If you forgot your iPhone passcode - Apple Support
Step 1: Make sure that you have a computer (Mac or PC)
This process requires a Mac or PC. If you're using a PC, make sure that it has Windows 10 or later, and that iTunes is installed. You also need the cable that came with your iPhone, or another compatible cable, to connect your iPhone to the computer.
If you don't have a computer and you can't borrow one, you need to go to an Apple Retail Store or Apple Authorized Service Provider for help.
Step 2: Turn off your iPhone
1. Unplug your iPhone from the computer if it’s connected.
2. Turn off your iPhone using the method for your iPhone model:
- iPhone 8, iPhone 8 Plus, iPhone X and later, including iPhone SE (2nd and 3rd generation): Press and hold both the side button and the Volume down button until the power off slider appears.
3. Drag the slider to turn off your iPhone, then wait a minute to make sure that it turns off completely.
Step 3: Put your iPhone in recovery mode
1. Get ready by finding the button on your iPhone that you'll need to hold in the next step:
- iPhone 8, iPhone 8 Plus, iPhone X and later, including iPhone SE (2nd and 3rd generation) use the side button.
2. Press and hold the correct button for your iPhone while immediately connecting your iPhone to the computer. Don't let go of the button.
3. Keep holding the button until you see the recovery mode screen on your iPhone, then let go.
If you see the passcode screen, you need to turn off your iPhone and start again.
Step 4: Restore your iPhone
1. Locate your iPhone in the Finder or in iTunes on the computer that it’s connected to. (Learn how to find your connected iPhone.)
2. Choose Restore when you see the option to Restore or Update. Your computer downloads software for your iPhone and begins the restore process. If the download takes more than 15 minutes and your device exits the recovery mode screen, let the download finish, then turn off your iPhone and start again.
3. Wait for the process to finish.
4. Disconnect your iPhone from the computer, then set up and use your iPhone.
We do want to let you know that these steps will remove all the data on your iPhone; however, if you have a recent backup available that can be restored when setting the iPhone back out.
For steps on how to restore a previous backup, check out this next link here: Restore your iPhone, iPad, or iPod touch from a backup - Apple Support
We hope that's able to help.
Take care!