Ping in Windows 10 & Windows 11

Settings > Privacy & Security > Windows Security > Firewall & Network protection > Allow an app through firewall
Control Panel > System and Security > Security and Maintenance > Security > Network firewall > Allow an app through firewall

Search “Firewall & network protection”

Enable “File & Printer Sharing”