Method of Dimensionality Reduction in Contact Mechanics and Friction