Calculate sample size for moderated mediation analysis

I am working on a study which involves moderated mediation analysis (1 IV, 1 Mod, 1 Med, 3 DVs), and I need to calculate the required sample size for my analysis. I got to know that R can perform this calculation via Monte Carlo Simulations, but I lack knowledge of the process and its exact codes. I would really appreciate if you could help me on where to start.