IIS error: W3SVC or WAS not found in Windows 11

I am trying to start a site in IIS, but I get the error W3SVC not found or started. I checked in services but w3svc or world wide web is not found. Please advise.

Check in Services if World Wide Web Publishing Service or W3SVC is found. If found, start it, else execute the below command in powershell with administartor privilege.

Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerRole, IIS-WebServer, IIS-CommonHttpFeatures, IIS-ManagementConsole, IIS-HttpErrors, IIS-HttpRedirect,  IIS-StaticContent, IIS-DefaultDocument, IIS-HttpCompressionStatic, IIS-DirectoryBrowsing

Check if the service is running using the below command

Get-Service W3SVC