  For a unital $C^*$-algebra $\mathcal A$ and a subspace $\mathcal B$ of
$\mathcal A$, a characterization for a best approximation to an element of
$\mathcal A$ in $\mathcal B$ is obtained. As an application, a formula for the
distance of an element of $\mathcal A$ from $\mathcal B$ has been obtained,
when a best approximation of that element to $\mathcal B$ exists. Further, a
characterization for Birkhoff-James orthogonality of an element of a Hilbert
$C^*$-module to a subspace is obtained.
