Multivariable Regression is what you are looking for!
Doing this by hand is hard, but if you are able to use a software its pretty straight forward.
https://helpfulstats.com/multiple-linear-regression-model/
So I must define the problem stated above. I must define the variables and the error associated with each one of them. Any Formula, Articles, Insight would be of great help!
Thanks in advance.