Greetings,
Welcome to the forum.
I am not a HP employee.
You have not provided a specific product number. I can't look at your product.
Your PC is very new. HP provides a stable factory operating system image at purchase. The one wildcard is if your PC updated to the latest version of Windows 10. You may need a updated audio driver.
Can you get sound using speakers?
A multitude of things could cause this problem if you are running the HP factory installed operating system:
1. Headphones (it appears you have eliminated this as a cause),
2. Corrupted drivers (what is happening in Control Panel, Device Manager, Sound)?
3. Faulty audio chip on the motherboard,
4. Audio output jacks are failing. Both front and back headphone jacks failing at the same time is very unusual
5. Check sound settings in Control Panel, Sound. Make sure nothing is disabled or muted. Verify the left and right audio channels are in equilibrium.
I would contact HP ASAP (Link) or return for a replacement PC if you are still in the return/refund window.
Regards