According to the philosophy of karma, what a person does comes back to him, more like newton’s third law. What we get in life is earned by us; part of it is from this life and remaining from earlier lives.
We take birth to spend the karma accumulated in earlier lives and while spending accumulated karma we end up creating new ones. And to spend this newly created Karma, we need to take additional births. This way the cycle of birth and death continues.
The way out here is living life without generating any new karma, and that way we can slowly clear the accumulated karma from previous lives and come out of this cycle of life and birth. And one of the easiest ways to live life without generating any new karma is following the philosophy of ‘Do good, because doing good is good, without expecting anything in return’.
The best example of this would be lives of people like Baba Amte, who spent their lives to help people in need. These people didn’t help others to get awards, recognition, money or publicity. They did it because they felt it was required and it is just good to help others.
Believing in god is optional for people who follow this path. A person can be atheist karma yogi, who’s sole goal is serve people, and can attain the self realization without having to believe in god at all.
Only thing a person following Karma Yoga has to ensure that, he/she stays away from the Karma-Abiman (pride of work). While It’s not required for the followers of this Yoga to believe in god, but if one believes it, that could help him/her to stay away from karmabhiman, as he/she can simply offer all the work at the god (or as god’s grace).