Then repeat by including C in the model A~B +C. This would give you an indication of how much of the relationship between A and B is mediated through C. But this method may produce bias results.
In the real setting, you will have other variables that could potentially affect C like unmeasured mediator-outcome confounding variable. There might be an interaction between exposure and mediator, and presence of intermediate confounding. Regression may not be sufficient in this instance.
You can consider using the following methods in causal inference framework: