Monte Carlo method in statistical physics