Thermodynamics is a branch of physics that studies the exchange of energy between systems in different forms such as work and heat. The first law of thermodynamics is the universal law of conservation of energy. The second law of thermodynamics shows that certain physical processes that do not occur spontaneously in nature even though they satisfy the conservation of energy. For example, heat naturally flows from hot bodies to cold ones and not the other way around. While the first law is satisfied at the microscopic level, the second law has a more probabilistic character that imposes limitations on the averages of energy exchanges over many microscopic realizations of a thermodynamic process, but not on a particular realization. Trying to better understand the second law of thermodynamics has led to the development of stochastic thermodynamics in which heat and work are understood as fundamentally stochastic quantities and in which the role of their fluctuations can be important. The advances made in recent decades in the manipulation of mesoscopic systems with optical tweezers now allow us to experimentally verify and exploit the principles of stochastic thermodynamics. In this program we will study some mesoscopic systems theoretically using the methods of stochastic thermodynamics.