Orthogonal series and approximations of functions