A general approach to approximation problems of the Bernstein type