When two systems are in thermal equilibrium, there is no net heat transfer between them. This occurs when the systems are at the same temperature. In other words, systems at the same temperature will be in thermal equilibrium with each other. The first law of thermodynamics relates changes in internal energy to heat added to a system and the work done by a system. We've talked about how heat can be transferred, so you probably have a good idea about what Q means in the first law.
Work is simply a force multiplied by the distance moved in the direction of the force.
A good example of a thermodynamic system that can do work is the gas confined by a piston in a cylinder, as shown in the diagram. If the gas is heated, it will expand and push the piston up, thereby doing work on the piston. If the piston is pushed down, on the other hand, the piston does work on the gas and the gas does negative work on the piston. This is an example of how work is done by a thermodynamic system. An example with numbers might make this clearer.