Since their discovery, cosmic rays have been an integral part of the development of fundamental physics, from the discovery of radiation coming to the Earth from outer space and the identification of high-energy particles in it, as well as new fundamental symmetries in the laws of nature, to the knowledge of residual matter and magnetic fields in interstellar space. Cosmic rays are used in a number of fundamental and applied research in solar-terrestrial physics and are important in the research of the near-Earth space processes. Cosmic ray variations observed on the Earth’s surface are an integral result of various solar, heliospheric, magnetospheric and atmospheric phenomena. The most significant changes in cosmic ray parameters are caused by coronal mass ejections and subsequent changes in the parameters of the interplanetary magnetic field and solar wind. Therefore, the study of cosmic rays makes it possible to obtain valuable information about the processes in the near-Earth space and in the Earth’s magnetosphere during disturbed periods. This article proposes a method for analyzing cosmic ray variations. It is based on the use of wavelet data decomposition operations and their combination with threshold functions. By using adaptive thresholds, the operations for detecting anomalous changes in data and for suppressing the noise were developed. Anomalies in cosmic rays can cause radiation hazard for astronauts, radio communication failures, as well as malfunctions in satellites, leading to the loss of orientation and destruction. Therefore, the task of timely diagnostics of anomalies is urgent. The paper describes the algorithms for the implementation of the method and shows their application in the space weather problem. We used data from the network of ground stations of neutron monitors. The efficiency of the method for detecting abnormal changes of different amplitudes and durations is shown. Application of the method made it possible to detect clearly and to evaluate Forbush effects in cosmic rays, which precede the onset of magnetic storms of various nature and strength.