If you have Windows 11 25H2,
Go to Settings > System
Scroll towards the bottom and click Optional features
Where it says "View or edit optional features" click on View features
Click on See available features
Scroll down and select Windows Media Player Legacy (App) > click Add