Position size and leverage in. The margin required and the percentage of your account it uses, out.
This is a simplified margin calculation. Actual margin requirements vary by broker, instrument, and market conditions, and can change without notice, especially during high volatility. Always confirm exact requirements with your broker before opening a leveraged position.
A position using a large share of available margin leaves little room for the trade to move against you before a margin call forces the decision out of your hands. Knowing the percentage of your account a position actually uses, before you enter, is part of sizing with discipline rather than sizing on confidence.