Can a person attain Moksha, if he/she do not pray or worship God but still continually does good work throughout his life?
Yes absolutely yes! It is possible to get Moksha by simply doing good deeds all your life. How?
Karma yoga implies performing good deeds (or any deeds for that matter) without expecting anything in return. This is the path exemplified by the great Lord Buddha. He neither believed nor advocated a belief in God. He simply asked everyone to follow the Truth.
Lord Krishna says in the Gita:
Therefore, without being attached to the fruits of activities, one should act as a matter of duty, for by working without attachment one attains the Supreme. [Gita 3:19]
Also in the Gita, Lord Sri Krishna says (thanks @KeshavSrinivasan for the reference)
You have a right to perform your prescribed duty, but you are not entitled to the fruits of action. Never consider yourself the cause of the results of your activities, and never be attached to not doing your duty. [Gita, 2:47]
In order to understand this, there are two sub questions:
What is the cause of suffering ?
The cause of suffering is
- Expectations (AKA desires AKA attachments).
For example, when you are in an examination, suppose that you didn't study anything. If you get 80%. You are overjoyed. But at the same time, suppose you studied everything. If you get 90% still you will be sad because you expected 100%. This is a simple scenario which can be extended upwards.
Sri Swami Vivekananda says that
It is our desire that binds us. If we take the results of actions, whether good or evil, we will have to bear them. Several quotes about desire by Swami Vivekananda
- Bad Karma
All that you do, comes back to You. This is the law of Karma. Thus if you do good deeds to others, good things come back to you.
We are responsible for what we are, and whatever we wish ourselves to be, we have the power to make ourselves. If what we are now has been the result of our own past actions, it certainly follows that whatever we wish to be in the future can be produced by our present actions; so we have to know how to act.
What is the meaning of Moksha ?
Moksha simply means that cessation of suffering. The destruction of the cause of suffering, leads to permanent happiness. By destruction of desires, there is no more karma in this world and therefore birth and death ceases.
Sri Swami Sivananda on Karma Yoga (selfless service without desires)
In the practice of Nishkama Karma Yoga, there is no loss of effort. There is no harm. There is no transgression also. Even a little of this practice can protect you from great fear of rebirth, of death with its concomitant evils. You will reap the fruits of Karma Yoga, viz. Jnana. There is no uncertainty here. The path of Karma Yoga eventually leads to the attainment of Bliss of the Self.
Is there an example of a karma yogi?
Lord Buddha set an example for humans along the path of Karma Yoga:
Sri Swami Sivananda says that karma Yoga by Sri Swami Sivannada:
If you really want to grow in the spiritual path you must do all sorts of service daily till the end of your life. Then only you are safe. Do not stop doing service when you have become a famous Yogi. The spirit of service must enter every nerve, cell, tissue and bone of your body. It must become ingrained in you. Then only you will become a real, full-blown, practical Vedantin. Is there any greater Vedantin or Karma Yogi than Lord Buddha ? He still lives in our hearts, because that spirit of service was ingrained in him and he spent his whole life in serving others in a variety of ways. He is indeed a magnanimous soul, one without a second. You can also become a Buddha if you apply yourself diligently to selfless service with the right mental attitude.
So in conclusion, by doing good deeds without attachment of results, we are attacking the two cause of suffering:
- Karma (by doing good deeds)
- Moha (by removing attachment)
All the best.