  The cooling theory of isolated neutron stars is reviewed. The main cooling
regulators are discussed, first of all, operation of direct Urca process (or
similar processes in exotic phases of dense matter) and superfluidity in
stellar interiors. The prospects to constrain gross parameters of supranuclear
matter in neutron-star interiors by confronting cooling theory with
observations of isolated neutron stars are outlined. A related problem of
thermal states of transiently accreting neutron stars with deep crustal heating
of accreted matter is discussed in application to soft X-ray transients.
