Orbital space telescope is a complex and expensive system. Electro-flywheel systems are used on such spacecraft as the orientation and stabilization system actuators making it possible to ensure the required accuracy of pointing an orbiting space telescope to a given region in the outer space. This paper considers the situation of failure of one of the flywheels on a spacecraft of the Hubble Space Telescope type. An algorithm for the orientation and stabilization system operation in such emergency was developed making it possible to ensure rotation of the spacecraft by a given angle with the remaining three controls functioning and without reducing the telescope pointing accuracy. A spacecraft model was created in the Simulink (MATLAB) dynamic simulation environment to develop this algorithm.