For a unital C*-algebra A and a subspace B of A, a characterization for a best approximation to an element of A in B is obtained. As an application, a formula for the distance of an element of A from B has been obtained, when a best approximation of that element to B exists. Further, a characterization for Birkhoff-James orthogonality of an element of a Hilbert C*-module to a subspace is obtained. © 2021 Ramanujan Mathematical Society. All rights reserved.