If there is no mathematical formula for the posterior distribution it can often be approximated by sampling from it. This is possible in Markov Chain Monte Carlo methods which sample one or more parameters conditional on the data and all the current values of other parameters.