"One of the complications that arise while drilling wells is hydraulic fracturing. Hydraulic fracturing pressure is the pressure at which the integrity of the rock in the walls of the well is compromised, leading to the formation of artificial cracks. Various authors have proposed formulas to determine the hydraulic fracturing pressure Phf in the absence of actual data. Рhf = 0.87 Рrock Рhf = 0.85 (Рrock – Рres) + Рres Phf = [μ/(1 – μ)] (Рrock – Рres) + Рres Рhf = [2μ/(1 – μ)] Рrock where: μ – Poisson's ratio, which takes values of 0.25–0.4 for dense clay, 0.33–0.4 for clay with sandstone interlayers, 0.1–0.2 for shales, 0.3–0.35 for sandstone, 0.28–0.33 for limestone; Рrock, Рres – rock and reservoir pressure, respectively. This study examines the problem of determining hydraulic fracturing pressure taking into account the heterogeneity of rocks. The work can be roughly divided into two parts. In the first part, the physical properties of porous bodies in contact with fluids are studied, treating them as a two-phase medium. When a porous body comes into contact with fluids, the fluids penetrate into them, transforming them into a two-phase medium. The term “fluids” refers to both liquids and gases, with real liquids considered incompressible and gases highly compressible. The remaining part of the porous body, excluding the pores, is called the skeleton. Pores in porous bodies are connected through capillary tubes. In the second part, the influence of the magnetic field and rock heterogeneity on the stability of the well wall is studied. Formulas are derived to determine hydraulic fracturing pressure, depending on the mechanical properties of the rocks and the reservoir pressure. Based on the theory of destruction, the critical value of excess pressure (or hydraulic fracturing pressure) is determined, which is necessary to ensure the safety of drilling oil and gas wells. The machines used in drilling operations in the oil and gas industry must be easy to operate, reliable, and capable of long-time use. When designing such machines, considerations such as being lightweight, economical, and quick and inexpensive to prepare should be taken into account from the outset.