The formula
Lot size = risk amount ÷ (stop distance × contract size × conversion to your account currency). The contract size is set by your broker for each instrument: commonly 100,000 units for major forex pairs and 100 ounces for gold, but always check your broker's specification.
Round down
Brokers allow sizes in steps, often 0.01 lots. Always round down, so the real risk stays at or below the amount you decided.