Brahmacharya is the fourth yama in the 8 limbs of yoga. It means ‘right use of energy’, and often translated to celibacy. It actually translate to ‘behaviour that leads to brahman’ which in other words mean behaviour that leads to a higher power/the divine/god.
It was used to encourage yogis to conserve their sexual energy and rather use it to progress on their yogic path. However, there are many other ways to look at how we can apply brahmacharya into our lives. For example, think of all the things you do, that you deep down know aren’t supportive to your spiritual progress.
Our external desires are all ‘wrong use of energy’ in terms of the yogic path. Brahmacharya encourage you to instead look within to find peace- and happiness, or whatever it is you may want.
Our external world may trigger a good feeling, but the feeling comes from within, therefor yogis look at ways to find this feeling without the need to get triggered from the external.