KE + PE + U = Q - W
Now perhaps you are wondering what on earth all those letters stand for?
Here are their definitions:
KE = Kinetic energy. This is the energy in something that is moving.
PE = Potential energy. This is the energy of something that has the potential to be moving.
U = Internal energy. This is the energy inside the system you have designated. It is a bunch of different things really. But I am still just learning what they all are. (which means, I don't totally understand it all myself, and I am just typing away quickly without looking up in my textbook for exact definitions)
Q = Heat transferred, I think. I can't exactly remember this one, but it does have to do with the heat that enters a system or leaves a system.
W = Work. This is work done by the system or done on the system.
I have mentioned "system" several times in my definitions. A system can be anything. Usually, we take a large complicated thing like a motor and we can call the whole thing a system, or we can break it into smaller parts and call each of those systems and so on. It depends on what you are trying to find and what choice of a system makes it easiest to find those things.