You have several options:
https://support.apple.com/en-us/HT201553
I would go for the direct connect route wherein you bypass your router by directly connecting the two systems together via a network cable.
edit 2: HardDrive is correct. If you plug the HP into the router and your mac is connected to wifi on that router then you are on the same network.