Answer
$m_1=\frac{Fd^2}{Gm_2}$
Work Step by Step
The given formula is
$\Rightarrow F=G(\frac{m_1m_2}{d^2})$
Multiply each side by $\frac{d^2}{Gm_2}$.
$\Rightarrow \frac{d^2}{Gm_2}\cdot F=\frac{d^2}{Gm_2}\cdot G(\frac{m_1m_2}{d^2})$
Cancel common terms.
$\Rightarrow \frac{Fd^2}{Gm_2}=m_1$
Hence, the solution is $m_1=\frac{Fd^2}{Gm_2}$.