In this paper, we propose a general method for controlling chaos in a nonlinear dynamical system containing a state-dependent switch. The pole assignment for the corresponding discrete system derived from such a non-smooth system via Poincaré mapping works effectively. As an illustrative example, we consider controlling the chaos in the Rayleigh-type oscillator with a state-dependent switch, which is changed by the hysteresis comparator. The unstable 1- and 2-periodic orbits in the chaotic attractor are stabilized in both numerical and experimental simulations.