Regarding your question about units:
Dont confuse temperature and energy/heat!
A sauna has air temperatures of about 80°C, and you can easily spend 10 minutes in there. Imagine swimming in a pool of water at the same temperature. That'd be a painful, if not deadly experience.
Sure, this also has something to do with heat transfer, but I think it clearly shows that at the same temperature, different media can contain very different amounts of thermal energy. (Google the term heat capacity)
Now for the calculations, the first law for a closed system is
$$\Delta U=\Delta Q+W$$
But rather than trying to just figure out which equation you have to use to get your answer, think about the meaning of those equations.
By convention (in some fields, the opposite convention is used, but that doesn't change anything about the logic behind it) work done by the system is negative. Think of an expanding piston - the piston 'comes out' and therby decreases the energy of the system.
You are told that the change of internal energy is $\Delta U= 34J-27J = 7 J$, so the overall energy of the system has increased.
Also, the system does $26J$ of work. As said before, work done by the system decreases it's energy.
So in the end, you have $7J$ more in your system than before, but you have also taken out $26J$ of energy. Energy cant be destroyed or created, only exchanged. So how much energy has to be added in the form of heat to make this work out?