Yatah pravrittirbhootaanaam yena sarvamidam tatam; Swakarmanaa tamabhyarchya siddhim vindati maanavah.
He from whom all the beings have evolved and by whom all this is pervaded, worshipping Him with his own duty, man attains perfection.
This shloka needs to be understood with a slightly higher level of spirituality. Lord wants us to understand here that when you perform a duty which is according to your dharma it is similar to worshiping the God who has created us. Lord also says that this is the God from whom all the living beings have evolved. Not only that the God who created this universe is present in all the living beings. So, one has to understand that identifying and doing actions that is in line with his own dharma is similar to worshiping the God every moment. This is the way a person can attain perfection, says Lord Krishna.
Extending Interpretation to Mankind’s Life!
How do you know what is your swa-dharma? Ask your soul. God created all of us and every life is a gradual progression in spirituality of an individual. In childhood you might want be a pilot or you want to be in army. The decision is purely based on senses as at that age one can never understand the urges of the soul. It is the teenage when an individual is able to understand the urge of his soul. If he is tamasic then he will naturally progress towards menial jobs and as the Rajasic quality increases he tends to become a trader and a warrior. That Rajasic guna turns sattwik and he slowly starts to get into philosophy, religion, teaching etc.
Thus when you talk to yourself in your teenage you will know what you want to be. A Tamasic person would want to enjoy and travel, Rajasic person might want to get into a leadership role and earn money, status and power and a sattwik person will always want to help people. This nature combined with the urges of soul makes a person choose his profession. Thus it becomes important for a person to follow the profession with a devotion that is equivalent to worshiping the God. That can only happen when the individual is 100% committed to his profession and that is the only way he attains perfection.