Try updating the BIOS and webcam drivers on the PC and check if it helps.
You can update the drivers on the PC using HP support assistant.
Refer this article to know more information about using HP support assistant. Click Here
Try the steps recommended below and check if it helps.
Add Imaging Devices Manually
Hold the Windows Key and Press R.
Type hdwwiz.cpl and Click OK
Click Action and choose Add Legacy Hardware
Click Next, and choose “Install the hardware that i manually select from the list” and click Next, scroll down to choose Imaging Devices and Click Next.
Locate the missing device through the manufacturer’s tab and add it.
Refer this article to further troubleshoot webcam issues with the laptop. Click Here
Also, try running a system diagnostics test on your PC and check if the hardware components on your PC are functioning correctly.
Refer this article to know more information about running system diagnostics on your PC.
Lastly, if the issue still persists after trying out the steps. It is a hardware issue with the PC.
Be alert for scammers posting fake support phone numbers and/or email addresses on the community. If you think you have received a fake HP Support message, please report it to us by clicking on "Flag Post".