A nuclear reactor itself is the heart of a nuclear power plant, much like a car has combustion chambers inside of its engine, which includes many more components for the purpose of getting someone from point A to point B.
A nuclear reactor is much like a chemical reactor except it is a vessel where atomic nuclei are broken apart and formed. When nuclei are broken, the reaction is called fission, and when nuclei are formed, the reaction is called fusion. Like chemical reactions, nuclear reactions can be exothermic (net energy generators) or endothermic (net energy consumers) and like chemical reactions, nuclear reactions can chain react.
Function Of Nuclear Reactor-
The sole function of a nuclear reactor is to channel and shepherd the nuclear reaction going on inside it. It does this via control of temperature (like in a chemical reactor), control of radiation (via absorption or generation of the radiation), and control of leakage (via physical reflectors or sometimes electric/magnetic fields)
Nuclear reactors are found in many sectors of industry from the electric power industry to medicine to high energy physics research as they offer the ability to change chemical elements into other chemical elements. This is called transmutation, and it is essentially doing reactions that the alchemists of old wanted to do (turning lead into gold) except for elements with industrial applications.
We currently use nuclear fission reactors for power as those are the reactions that we can safely control. Humanity is working on making nuclear fusion power reactors so that we won’t have to deal with long-lived radioactive elements, however, as of yet, this hasn’t been achieved yet. However, both nuclear fission and fusion are routinely used to produce needed elements in medical labs, doctor’s offices, oil/gas drilling rigs, and spacecraft as means of producing radiation for imaging inside solid objects.