How does the nucleas of an atom get energy?
I don't fully understand your question.
Nuclear fission and nuclear fusion both produce enegry by converting some of the mass of the nuclei involved into energy. Specifically the total mass of the resulting particles is less than that of the original, where the difference becomes energy from E=mc2.
This is true, but it is also true for burning wood, for instance. There's nothing special about nuclear energy "converting mass into energy": every form of increasing binding energy will "reduce mass" and "produce energy". Only, in nuclear reactions, the release of energy is so large as compared to others, that this universal effect becomes measurable.
Nuclear energy is released by re-arranging the neutrons and protons into different conglomerates (nucleae), in such a way that the total binding energy of the system AFTER is larger than the total binding energy BEFORE, and the difference is liberated, in the form of kinetic energy of the parts (ultimately becoming heat), or in the form of gamma rays.
This is exactly the same as what happens when you burn something: the atoms re-arrange in different molecular structures in such a way that the total binding energy of the molecules (usually CO2 and H2O) AFTER is higher than the total binding energy of the combustible material (and oxygen) BEFORE.
What you say is true, but how does this address the original question?
As the original question wasn't clear, I addressed it in the same way as your answer, namely how do nucleae "make" energy (in a power reactor for instance).
Separate names with a comma.