A simple method is to build a process whose stationary distribution is precisely your target distribution. Then sample trajectories of the process and take points of these trajectories that have enough separation to overcome correlations. These points should be distributed according to your target distribution.
In more detail, for multiple dimensions, the process
$$
d \vec{X}_t = -\nabla\cdot V\left(\vec{X}_t\right)\,dt+\sqrt{\frac{1}{\beta}}\,d\vec{W}_t,
$$
where each component of $\vec{W}_t$ is a Wiener process (without correlations among them), has your target distribution as stationary distribution. Say $M$ is the number of samples that you want to get, then the algorithm would look something like:
- Initialize the process, I would select $\vec{X}_0$ as a minima of the potential. If $V$ has many different minima this could be an important step.
- Select integration time step $\Delta t$.
- Select number of iterations between measures $n$.
- Iterate the following formula $n\cdot M$ times: $\vec{X}_{t+\Delta t} = -\nabla\cdot V\left(\vec{X}_t\right)\,\Delta t+\sqrt{\frac{\Delta t}{\beta}}\,\vec{G}(0,1)$. Where $\vec{G}(0,1)$ is a vector of random numbers with zero mean and variance 1.
- Your samples correspond to the states $\{\vec{X}_{n\Delta t},\vec{X}_{2n\Delta t},\dots,\vec{X}_{Mn\Delta t}\}$.
The tricky steps are to fix $n$ and $\Delta t$ to ensure precision at reasonable computation times.
The nice thing about this method is that it is quite general, however, it is very inefficient with many dimensions (as it requires evaluating $V$ in every iteration). There are many other methods that you can use, such as rejection, inversion method, etc. The best method to use depends on your particular problem (form of $V$). This is a nice reference for methods of random number generation: Stochastic Numerical Methods: An Introduction for Students and Scientist.