You can calculate kilojoules from watts and seconds, but you can't convert watts to kilojoules since watt and kilojoule units represent different quantities.
The energy E in kilojoules (kJ) is equal to the power P in watts (W), times the time period t in seconds (s):
E(kJ) = P(W) × t(s) / 1000
kilojoules = watts × seconds / 1000
kJ = W × s / 1000
What is the energy consumption of an electrical circuit that has power consumption of 300 watts for time duration of 3 seconds?
E(kJ) = 300W × 3s / 1000 = 0.9kJ