Methods to control friction in systems under shear are proposed, which enable eliminate chaotic stick-slip motion, and modify frictional forces. The possibilities to control friction are demonstrated using a model system that displays the main experimentally observed behaviors, obtained in measurements on nanoscale confined liquids and granular layers. The methods should be applicable to real systems for which time series of dynamical variables are experimentally available. The only necessary condition is the existence of (possibly unstable) sliding regimes of motion in the experimental systems.