How can I obtain a conditional distribution from a joint distribution using a MCMC sample? Suppose that $\theta = (\theta_1,\theta_2) \in{\mathbb R}^2$ are the parameters of a model, and that I can obtain a MCMC sample from the posterior distribution of $\theta \mid {\bf x}$.
Using the MCMC sample, how can I obtain the conditional posterior distribution
$$\theta_2 \mid \theta_1, {\bf x}\,?$$

If one is using a Gibbs sampler, which is a specific type of MCMC algorithm, the conditional distributions of $θ_1$ given $θ_2,x$ and of $θ_2$ given $θ_1,\mathbf x$ are a requirement for running the algorithm. Hence $\pi( θ_2|θ^0_1,\mathbf x)$ is available as a generative model, if not necessarily in closed form.
Otherwise, in the general case, a sample from $$\pi(\theta_1,\theta_2|\mathbf x)\propto p(\mathbf x|θ_1,θ_2)π(θ_1,θ_2)$$ does not provide direct information about $\pi( θ_2|θ^0_1,\mathbf x)$, except by using a non-parametric estimator of the conditional density. Except for special cases, one need run a new MCMC algorithm with target $$\pi( θ_2|θ^0_1,\mathbf x)\propto p(\mathbf x|θ^0_1,θ_2)π(θ^0_1,θ_2)$$where $θ^0_1$ is the value of $θ_1$ one wants to condition upon.
