Pratyahara (Devan?gar? ?, Tibetan , Wylie so sor sdud pa) or the 'withdrawal of the senses' is the fifth element among the Eight stages of Patanjali's Ashtanga Yoga, as mentioned in his classical work, Yoga Sutras of Patanjali composed in the 2nd century BCE. It is also the first stage of the six-branch yoga (?a?a?gayoga) of the Buddhist K?lacakra tantra, where it refers to the withdrawal of the five senses from external objects to be replaced by the mentally created senses of an enlightened deity. This phase is roughly analogous to the physical isolation (k?yaviveka, Tib. lus bden) phase of Guhyasam?ja tantra.
For Patanjali, it is a bridge between the bahiranga (external) aspects of yoga namely, yama, niyama, asana, pranayama, and the antaranga (internal) yoga. Having actualized the pratyahara stage, a practitioner is able to effectively engage into the practice of Samyama. At the stage of pratyahara, the consciousness of the individual is internalized in order that the sensations from the senses of taste, touch, sight, hearing and smell don't reach their respective centers in the brain and takes the sadhaka (practitioner) to next stages of Yoga, namely Dharana (concentration) and Dhyana (meditation), and Samadhi (mystical absorption), being the aim of all Yogic practices.
Pratyahara is derived from two Sanskrit words: prati and ahara, with ahara meaning food, or anything taken into ourselves, and prati, a preposition meaning away or against. Together they mean "weaning away from ahara", or simply ingestion.
Prati in Sanskrit can also mean "copy". So in effect Pratyahara means that your 5 external senses can be copied and replaced by 5 internal representations/copies of those same senses.
This involves withdrawal of senses, or sensory inputs into our physical being, coming from our five senses, namely organs creating a sensory overload, and hence hinders collection of the mind, as in Dharana, the next stage of Yoga 
Control of our senses requires mastery over the flow of prana, as that is what drives the senses. To stop the scattering of valuable vital energy of the body or prana, we need to seek control over its flow, and harmonize it. This is done through various practices including bringing the entire focus to a single point in the body.
These two lead to the subsequent two types of pratyahara, the Control of Action or 'Karma pratyahara', which entails not just control of motor organs, but also right action or work, and Karma Yoga, surrender of every action to the divine and performing it as an act of service. This leads to the final form of pratyahara - the Withdrawal of Mind or 'Mano pratyahara', which is practiced by consciously withdrawing attention from anything that is unwholesome, and distracting for the mind such as by withdrawing attention from the senses, and directing it inwards 
One of the most common practices for Pratyahara is Pranayama, wherein we automatically withdraw from the external and bring our focus inwards towards our breath, as connection with the external senses and stimuli are all severed gradually.
Another common technique for inducing Pratyahara is to first reduce physical stimuli, then concentrate on one sense, such as hearing. The mind has a natural tendency to roam between the sensory inputs. In this situation, as there are no longer any other significant sensory inputs, when the mind gets tired of hearing, it is forced to turn inward.
At the advanced levels, the currents which pulsate through the nerves and even the involuntary muscles are turned off by the practitioner. This may also be accomplished through Pranayama or breath-control.