It doesn't need to be previously set up with the laptop. You can use any Windows or Mac computer.
You need to be sure the phone is turned off before you start and pay particular attention to the following step:
iPhone 6s or earlier, iPod touch (6th generation or earlier), or iPad with Home button: Press and hold the Side (or Top) button until the power off slider appears. Drag the slider to turn off your device.
Connect your device to your computer while holding the Home button. Keep holding the Home button until you see the recovery mode screen.
If you follow the steps exactly and it doesn't work, see the Get more help section in If you forgot the passcode for your iPhone, iPad, or iPod touch, or your device is disabled - Apple Support