There are four varnas (classes). Their names are brahmana, kshatriya, vaishya and shudra.
The duties of a brahmana are to donate alms, perform tapasya, worship the gods, perform yajnas and study the Vedas. To earn a living, brahmanas are authorized to teach and act as priests at sacrifices. The duties of kshatriya are to beat arms and protect the earth, donate alms and perform sacrifices. A kshatriya is also permitted to study the shastras. The duties of a vaishya are agriculture, animal husbandry and trade. That apart, vaishyas should donate alms, perform sacrifices and study the shastras. The duties of a shudra are to serve brahmanas. Shudras can also be shopkeepers and artisans.
In times of emergency, a brahmana is allowed to adopt the livelihoods of kshatriyas or vaishyas to earn a living. In similar fashion, a kshatriya is permitted to adopt the livelihoods of vaishyas or shudras and a vaishya is permitted to adopt the livelihoods of shudras.
There are four ashramas (stages of life) as well. The first of these is known as brahmacharya (celibate studenthood). During this period, the individual spends his days with his guru and studies the Vedas well. He has to serve his guru in proper fashion and live on alms. The next ashrama is that of Grihastha (householder stage). The individual now gets married and has children. He serves the gods, the sages, the ancestors and guests. It is householders who provide alms for sages and hermits. That is the reason why the householder stage is so very important. The third ashrama is known as vanaprastha (forest-dwelling stage). The individual now retires to the forest and withdraws his mind from the earthly life. He can leave his wife in the care of his sons or take her with him. He lives on roots, fruits and leaves and makes a bed for himself under the trees. He is not permitted to shave or cut his hair and his clothes have to be made out of bark or skins. The final ashrama is that of sannyasa (hermithood). A hermit gives up all association with the world and lives alone. He grows completely detached. He lives alone. He gets his food through begging. He is not permitted to spend more than one night in a village, or more than five nights at a time in a city.