For the power matter, you don’t. The device being charged, the charger, and cable does.
If you mean what is the maximum wattage that will actually be used, that should be the maximum possible between the charger, cable, and device. So look at their specs. Whichever has the lowest maximum, is what the others will match.
USB PD defines a protocol for the device and charger to determine max safe power. If the cable is replacable (not attached to the charger), it must be rated for PD and be able to tell the charger it can handle more than just the usual 5 volts at 2 amps.
USB PD chargers only output the maximum safe amount of power. That’s why I can use my 65W steamdeck charger to charge my phone if I want to. It just outputs normal USB charger power if the device on the other end can’t verify it can handle more.
It’s also why my SteamDeck charger is what I use to fast charge my phone, because it can actually talk to it using the USB PD protocol to request the voltage and amps it needs to fast charge.
To clarify; I have a 100W Ugreen Nexode 4 Port USB Charger that I use to charge my laptop (~60W), Steam Deck (~40W), iPhone (~20W) and AirPods (~5?W).
The problem is if my original product cable has gone walkabout temporarily and I need to use a random one to stand in - there is no clear way of telling if I’m accidentally using a 5W-max cheap cable to try and keep my laptop charged while working.
Obviously there are some context clues depending on cable thickness etc., but with how common cosmetic braiding is becoming a thing - even that’s getting harder to rely on.