In words of Guru Gobind Singh Ji Khalsa is:
"He who keeps alight the unquenchable torch of truth, and never swerves from the thought of One God; he who has full love and confidence in God and does not put his faith, even by mistake, in fasting or the graves of Muslim saints, Hindu crematoriums, or Jogis places of sepulchre; he who recognises the One God and no pilgrimages, alms-giving, non-destruction of life, penances, or austerities; and in whose heart the light of the Perfect One shines, - he is to be recognised as a pure member of the Khalsa"
Guru Gobind Singh invited his followers from all over India to a special congregation at Anandpur on Baisakhi Day, 30 March 1699. He asked, with a naked sword in his hand, "Is there any one among you who is prepared to die for the Sikh Faith?" When people heard his call, they were taken aback. Some of the wavering followers left the congregation, while other began to look at one another in amazement. After a few minutes, a Sikh from Lahore named Daya Ram stood up and offered his head to the Guru. The Guru took him to a tent pitched close by, and after some time, came out with a blood-dripping sword. The Sikhs thought Daya Ram had been slain. The Guru repeated his demand calling for another Sikh who was prepared to die at his command. The second Sikh who offered himself was Dharam Das. Thereafter, three more, Mohkam Chand, Sahib Chand and Himmat Rai, offered their lives to the Guru.
Later, these five Sikhs were given new robes and presented to the congregation. They constituted the Panj Pyare: the Five Beloved Ones, who were baptised as the Khalsa or the Pure Ones with the administration of Amrit. The Guru declared:
Since Guru Nanak, it is the Charanamrit (water used for washing the Guru's feet) which has been administered to the devotees. But from now on, I shall baptise them with water stirred with a double-edged sword - Khanda.
Upon administering amrit to the Five Beloved Ones, the Guru asked them to baptise him in the same manner, thus emphasising equality between the Guru and his disciples.
Guru Gobind Singh named the new ceremony, Khanday-da-Amrit, namely the baptism of the double-edged sword. He stirred water in an iron bowl with the sword, reciting five major compositions, Japji, Jaap, Anand Sahib, Ten Sawaiyas and Chaupi, while the five Sikhs stood facing him. The Guru's wife put some sugar-puffs into the water. The nectar thus obtained was called Khanday-da-Amrit. This implied that the new Khalsa brotherhood would not only be full of courage and heroism, but also filled with humility.
Briefly, the Khalsa concept has been captured by G.C. Narang in Transformation of Sikhism:
Abolition of prejudice, equality of privilege amongst one another and with the Guru, common worship, common place of pilgrimage, common baptism for all classes and lastly, common external appearance - these were the means besides common leadership and the community of aspiration which Gobind Singh employed to bring unity among his followers and by which he bound them together into a compact mass.
The creation of Khalsa marked the culmination of about 240 years of training given by the ten Gurus to their Sikhs. The Guru wanted to create ideal people who should be perfect in all respects, that is a combination of devotion (Bhakti) and strength (Shakti). He combined charity (Deg) with the sword (Tegh) in the image of his Sikh.
The Khalsa was to be a saint, a soldier and a scholar, with high moral and excellent character. He or she would be strong, courageous, learned and wise. In order to mould his personality the Guru inculcated in him the five virtues - sacrifice, cleanliness, honesty, charity and courage, and prescribed a Rehat - the Sikh code of discipline. His character would be strengthened by the spirit of God revealed in the Guru's hymns. For this purpose he was asked to recite the five sacred composition or Banis daily.
The combination of virtue and courage is the strength of the Khalsa. This is an assurance against the ruthless exploitation of masses by their masters, and a device for overcoming hurdles that lied in the practice of holiness and spiritualism in daily life. Guru Gobind Singh commanded the Khalsa to use the sword only in times of emergency, that is, when peaceful methods failed and only for self-defence and the protection of the oppressed. His spirit will continue to inspire them for the preservation of peace, order and dignity of mankind for all time to come.
The following instructions are given to those undergoing the baptizing ceremony:
(a) You shall never remove any hair from any part of thy body, (b) You shall not use tobacco, alcohol or any other intoxicants, (c) You shall not eat the meat of an animal slaughtered the Muslim way, (d) You shall not commit adultery. The initiate is required to wear the physical symbols of a Khalsa at all times as well as follow the Khalsa Code of Conduct.
In brief, the Khalsa's code of conduct is:
For more details refer the Rehat Maryada which explains the complete code of conduct.