Gorakh Nath ji is considered to be a form of Shiva. Once lord Shiva has engaged in an argument with Shakti. Shakti told Shiva that she had the power to awaken desire in anyone. Shiva disagreed with him. Following her challenge Shiva appeared in the form of Gorakhnath on the earth.
In his form as Gorakhnath, he showed that negativity of human character can be conquered and complete freedom from all desires of kaam (sexuality), krodh (temper), mad (ego), lobh (greed) and moh (worldly attachment) can be achieved through yoga.