If you come across an error indicating that Windows Defender Firewall is preventing your device from connecting to the computer, you will need to disable Windows Defender Firewall. Follow the detailed instructions below to solve this problem.
Method 1: Use the Control Panel
1. Begin by typing Control Panel into the search box. Next, select System and Security to continue.

2. Then, click Windows Defender Firewall.

3. Click on Turn Windows Defender Firewall on or off in the left panel.

4. Please select the box next to Turn off Windows Defender Firewall and then click OK.

Method 2: Disabling the Firewall for a specific program
1. Go to Settings and select Firewall & network protection.

2. Locate and select Allow an app through firewall and click on it.

3. In the end, select the box next to the desired app or program to grant permission, and then click on OK.
Method 3: Type a command prompt
In the end, an alternative method to disable your Windows Defender Firewall is by using the command prompt. You can simply search for Command Prompt in the search box, then enter the command netsh advfirewall set all profiles state off to run the script, and turn off the firewall.