Three true machines, one fits
Power is the rate at which electrical energy becomes something else — heat in a resistor, torque in a motor, light in a lamp. It is measured in watts, one joule per second, and there are three relations for it. All three are true. Only one of them usually fits the numbers you were given, and choosing it is the entire skill.
— P equals V I — where is the power in watts, is the voltage across the component in volts and is the current through it in amperes. This is the parent: energy per charge, multiplied by charge per second, gives energy per second.
Substitute Ohm's law into it and the other two fall out. Put in and you get — P equals I squared R — with the resistance in ohms; this is the Joule-heating form, and it is how every resistor, conductor and winding is sized for heat. Put in instead and you get , the form for anything held across a fixed supply.
The choosing rule is mechanical: look at which two of , and the problem actually gives you, and take the relation built from those two. And notice the two forms pull opposite ways, which trips people every year. At a fixed CURRENT, more resistance means more heat. At a fixed VOLTAGE, more resistance means less. Both are correct; they answer different questions.