@RP9882 Here's what you need to do, to identify the issue and resolve it accordingly:
If not done already, check if it works fine on the BIOS screen to identify if it's either a hardware or a software issue:
If it works fine on the BIOS (Accessed while tapping F10 during a restart) it's a software issue & I suggest attaching an alternate monitor to your device and creating a new user account to check if that works better, for starters)
However, if it doesn't work within the BIOS either, I'm afraid it's a hardware malfunction.
While you respond to that, I have a few more steps that should help:
Perform a power reset (no data loss) using these steps: Click here, proceed to next step if this works
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".