1, Click on Start menu, search for Windows Defender Firewall.
2, In the left upper corner click on Allow an app or feature through Windows Defender Firewall
3, Under the list click on Allow another app button
4, Click on Browse button, then locate the executable program that you wish to allow on the firewall (for example in case of Fivem, you need fxserver.exe), then click on Add button. After this tick in the row to allow it, then click Ok.