How is rest mass $m_0$ in $E=m_0c^2$ related to mass $m$ in $F=ma$?

To be frustratingly concise, they are the same quantity. In fact, that was the whole genius of Einstein to realize that the inertia of a particle (the "measurement of how much a particle accelerates given a force") is really a measure of its energy. Thus, the title of his $$1905$$ paper: "Does the inertia of a body depend on its energy content?".

Now, the playground for this story is a bit muddled due to one of the most unfortunate notions in the history of modern physics: the relativistic mass. This is the reason you misspelled the Einstein mass-energy relation as $$E=m_0 c^2$$ instead of correctly spelling it as $$E_0=mc^2$$. But, I will come to this point later, for now, I will try to bypass this issue. Anyway, let's dive in.

So, in special relativity, the total energy of a particle (or, simply, the energy of the particle) and the momentum of a particle are given by $$E=\frac{mc^2}{\sqrt{1-\frac{v^2}{c^2}}}=mc^2\Big[1+\frac{1}{2}\frac{v^2}{c^2}+\frac{3}{8}\frac{v^4}{c^4}+\cdot\cdot\cdot\Big]$$$$\vec{p}=\frac{m\vec{v}}{\sqrt{1-\frac{v^2}{c^2}}}=m\vec{v}\Big[1+\frac{1}{2}\frac{v^2}{c^2}+\frac{3}{8}\frac{v^4}{c^4}+\cdot\cdot\cdot\Big]$$Here, the $$m$$ that I have used is the mass of the particle, or, as people liked to call it in the early days of relativity, the rest mass of the particle. Now, the key feature to notice here is that it is the same $$m$$ in the expression for the energy as it is in the expression for the momentum. Now, when you take the limit in which $$\frac{v}{c}$$ is small and retain the first non-trivial contribution from $$v$$, you get the usual Newtonian relations $$E=mc^2+\frac{1}{2}mv^2$$ $$\vec{p}=m\vec{v}$$Now, at this moment, you can easily see that it is the same $$m$$ in the formula for the Newtonian $$\vec{p}$$ that would appear in $$\vec{F}=m\vec{a}$$. Moreover, you also notice that it is the same $$m$$ in all the four expressions that I have written. In particular, it is the same $$m$$ in $$E=mc^2+\frac{1}{2}mv^2$$ (which contains the famous $$E_0=mc^2$$ where $$E_0$$ means the energy of the particle when $$v=0$$, or, in other words, its rest energy). In Newtonian mechanics, we don't carry along the $$mc^2$$ term in the expression for $$E$$ because, essentially, we assume that $$m$$ doesn't change and thus, $$\frac{1}{2}mv^2$$ alone is a good enough (conserved) quantity which is worthy of being named energy. But, the main point is that it is the same $$m$$ that dictates the inertia (via entering the formula for the momentum) of the particle that dictates its rest-energy (via entering the formula for, well, the rest-energy).

So, in order to preserve the relation that momentum is mass times velocity, people invented the term relativistic mass $$M$$ defined as $$\frac{m}{\sqrt{1-\frac{v^2}{c^2}}}$$ and happily wrote $$\vec{p}=M\vec{v}$$ while being relativistically correct. But, apart from being a linguistic nightmare where you necessarily needed to invent the term rest mass to distinguish the relativistically invariant mass from the made-up relativistic mass, it was also a physically problematic scheme as best explained by Lev Okun in this article. So, now, we only have one mass, the mass, or if you really wish, the rest mass. But, the total energy is not equal to $$mc^2$$ it is only the rest energy which is equal to $$mc^2$$. So, one should only write $$E_0=mc^2$$. With the forbidden relativistic mass, you could simply write $$E=Mc^2$$ where $$E$$ would have the right to be called the total energy and not just the rest energy, but, it was just not worth it!