After connecting it to your friends phone, is it now signed into their Apple ID, their Home App and their wifi? It needs to be on your Apple ID and on the same home wifi network your iPhone is on.
You might try resetting HomePod now so you can start from scratch setting it up and to erase your friends data.
Press the top of HomePod to reset it
Start by plugging it in, then:
- Unplug HomePod or unplug the power adapter for HomePod mini. Wait 10 seconds, then plug HomePod back in.
- Wait 10 seconds, then touch your finger to the top of HomePod and hold it there.
- The white spinning light will turn red. Keep your finger down.
- Siri will say that your HomePod is about to reset. When you hear three beeps, you can lift your finger
After it’s been reset try setting it up again
First update your iPhone to 16.1
Bluetooth and Keychain need to be enabled on your iPhone.
Follow the instructions here:
Set up and use HomePod mini and HomePod - Apple Support
See: If you can't set up HomePod mini or HomePod if you’re having trouble setting it up