It appears that you have a prescriptive analytics problem, which involves finding optimal combination of inputs based on desired outcomes. This term is commonly used in some fields (like business) and may help you find appropriate methods for your problem. If you are using software like RapidMiner, you can refer to its documentation on prescriptive analytics (https://docs.rapidminer.com/8.2/studio/operators/scoring/prescriptive_analytics.html) for more information.
If you are using programming languages like R or Python, you can explore constraint optimization packages. In your case, assuming you have a machine learning model called $h(\cdot)$ that takes numerical inputs $x$ representing your variables and predicts a numerical score indicating the "probability" of a positive outcome, you essentially have an optimization problem of the form $\text{argmax}_x\ h(x)$.
In your specific case, the machine learning model used is Random Forest. It is important to ensure that your model predicts a score rather than a categorical outcome, as many implementations of Random Forest classifiers typically provide categorical predictions by default. In R, you can accomplish this by using the predict function with the argument predict(rf, type = "prob", newdata=x). However, as said before by Kolassa, if your variables are dependent on each other, you would need to include this dependency as a constraint since they cannot vary independently. For example, if variable B and variable A, and typically A < 2 * B, then this would need to be added as a constraint.