There is substantiated the expediency of using the methods of the queuing theory for making managerial decisions in the face of uncertainty and risk. The model of organizing repair works at oil and gas companies has been improved, and its implementation ensures the optimization of the costs of maintaining repair crews and the reduction of losses from well downtime. Well repair by repair crews is considered as a multichannel queuing system in which the flow of service requests is the flow of repair applications, and the maintenance procedure consists of providing a repair crew according to applications in the order they are received. The maintenance procedure consists in the use of a repair crew according to the application, which is considered completed after the completion of the work of this crew at the facility, and the order of satisfying applications is carried out in the order they are received. Testing the proposed model of organizing repair works on the example of the fields of the three largest oil and gas companies in the Western region of Ukraine made it possible to establish that an increase in the failure rate requires an increase in the number of repair crews. However, such an increase is not always advisable, since the costs of maintaining the crews begin to exceed the losses from the downtime of the wells. The problem has been solved by the simulation method to optimize the elimination of failures of tubing (breaks) in the fields of the studied oil and gas producing enterprises, the process of which includes operations associated with the formation, transformation and implementation of random events, variables and processes that cause random changes in the state of such a system.