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