The four varnas were - Brahmins, Kshatriyas, Vaishyas and Shudras.
Brahmins were the priests who performed religious rituals. Kshatriyas were the warrior class who fought wars. Vaishyas engaged in agriculture and business. Shudras served the upper classes and did menial jobs. They emerged towards the end of the Rig Vedic period.
The varna system was inhumane for the Shudras who were at the lower strata of the system and they were forced to do menial and unclean jobs.