Write $F(\hat{x})$ as a power series with arbitrary coefficients. Use linearity to express $[\hat{p}, F(\hat{x})]$ as a power serieslinear combination of commutators of the form $[\hat{p}, \hat{x}^n]$. You can calculate the latter commutator using induction and the identities $[A, BC] = B [A, C] + [A, B]C$ and $[\hat{x}, \hat{p}] = i \hbar$. Then recombine the power series into a single expression.