A simple model of microscopic thermal machine which can work as a heat engine or refrigerator is discussed. This model serves as a tutorial example of quantum thermodynamics and shows that with the proper definitions of fundamental thermodynamical notions the standard formulation of the laws of thermodynamics remains valid also in the quantum domain.