Install Rstan
Install R and Rstudio
Visit the web page of https://mc-stan.org/users/documentation/ and see Documentation
Install Rtools (Windows users) or Xcode (Mac users) . See https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started
install packages: rstan
Reference
Jim Albert (2009) Bayesian Computation with R (2nd edition). Springer