Follow these steps:
- Open Settings → System → Projecting to this PC.
- Under Add the “Wireless Display” optional feature, select Optional features.
- Click View features or Add an optional feature.
- Search for Wireless Display, select it, and click Next → Install.
- After installation, search for Wireless Display from the Start menu and open the app.
- In Projecting to this PC, set the permission to Available everywhere or Available everywhere on secure networks.
If issue remains, Check this microsoft page for detailed instructions on this: