In recent years, the study of heat to work conversion has been re-invigorated by nanotechnology. Steady-state devices do this conversion without any macroscopic moving parts, through steady-state flows of microscopic particles such as electrons, photons, phonons, etc. This review aims to introduce some of the theories used to describe these steady-state flows in a variety of mesoscopic or nanoscale systems. These theories are introduced in the context of idealized machines which convert heat into electrical power (heat-engines) or convert electrical power into a heat flow (refrigerators). In this sense, the machines could be categorized as thermoelectrics, although this should be understood to include photovoltaics when the heat source is the sun. As quantum mechanics is important for most such machines, they fall into the field of quantum thermodynamics. In many cases, the machines we consider have few degrees of freedom, however the reservoirs of heat and work that they interact with are assumed to be macroscopic. This review discusses different theories which can take into account different aspects of mesoscopic and nanoscale physics, such as coherent quantum transport, magnetic-field induced effects (including topological ones such as the quantum Hall effect), and single electron charging effects. It discusses the efficiency of thermoelectric conversion, and the thermoelectric figure of merit. More specifically, the theories presented are (i) linear response theory with or without magnetic fields, (ii) Landauer scattering theory in the linear response regime and far from equilibrium, (iii) Green-Kubo formula for strongly interacting systems within the linear response regime, (iv) rate equation analysis for small quantum machines with or without interaction effects, (v) stochastic thermodynamic for fluctuating small systems. In all cases, we place particular emphasis on the fundamental questions about the bounds on ideal machines. Can magnetic-fields change the bounds on power or efficiency? What is the relationship between quantum theories of transport and the laws of thermodynamics? Does quantum mechanics place fundamental bounds on heat to work conversion which are absent in the thermodynamics of classical systems?