When you encounter an error showing that Windows Defender Firewall is blocking your device to computer connection, you need to turn off Windows Defender Firewall, and here's what you need to do:
Method 1. Use the Control Panel
1. Search Control Panel in the search box, then select System and Security to proceed.
2. Then, choose Windows Defender Firewall.
3. In the left panel, click Turn Windows Defender Firewall on or off.
4. Now, check the box ahead of Turn off Windows Defender Firewall box and click OK.
Method 2. Turn off Firewall for a program
1. Open Settings, and then click Firewall & network protection.
2. Find and click Allow an app through firewall.
3. Finally, click the box next to the app or program you want to allow, then click OK.
Method 3. Use the command prompt
Another way you can try is to use command prompt to turn off your Windows Defender Firewall. Just search for Command Prompt in the search box. Then, enter the command of netsh advfirewall set allprofiles state off and the command prompt will run the script to disable your Windows Defender Firewall.