In this paper, the full electromagnetic code KARAT is presented in detail, the scope of which is a computational experiment in applied problems of engineering electrodynamics. The basis of the physical model used is Maxwell’s equations together with boundary conditions for fields, as well as material equations linking currents with field strengths. The Particle in Cell (PiC) method for the kinetic description of plasma is implemented in the code. A unique feature of the code KARAT is the possibility of the self-consistent modeling of inelastic processes, in particular, nuclear reactions, at each time step in the process of electrodynamic calculation. The aneutronic proton–boron nuclear reaction, accompanied by the release of almost only α-particles, is extremely in demand in medicine and, perhaps, in the future, will form the basis for obtaining “clean” nuclear energy. The results of a numerical simulation within the framework of the code KARAT of the key physical processes leading to the proton–boron fusion are presented and discussed both for laser-driven plasma and for a plasma oscillatory confinement scheme.