The formation of a conditional connection allows the organism to change its reactions to various environmental factors, combining and mobilizing the necessary internal adaptive processes. It is assumed that there are common mechanisms underlying the formation of adaptive processes – stress response and learning. To develop methods for non-invasive correction of nervous system pathologies at a model object of genetics – Drosophila, the relationship of adaptive mechanisms of the formation of a conditional connection and the development of a stressor reaction to the weakening of the Earth’s magnetic field in light: dark conditions was studied. The role of learning and lighting in overcoming stress in connection with the formation of long-term memory in the paradigm of conditioned courtship suppression was revealed. Within the framework of quantum dynamics of electronic and nuclear spins of transition states of radical molecules, the hypothesis of their participation in the formation of long-term memory is considered.