Lot of people, who are trying to be good, always have one complaint.
We are all so good. This world is messed up. Given that, how can we be good in this non-good world?
When people reach little more advanced state, they understand how naive this question is. But, Vedanta spirituality is all about starting to make progress, one step at a time, from whatever your state of spiritual maturity may be. Always using lower truth to get to higher truth.
Vedanta uses two powerful metaphors as advice to people with this question. Questions of this kind boil down to one thing - how to be in this world but still not become one with 'this' world?
First metaphor is that of lotus flower.
One of the names for lotus in Sanskrit is 'Pankaj'. Pankaj literally means 'one that is born in the mud.' Lotus which is considered most regal among flowers is born in the mud and rises from the bottom of a muddy pond tracing its growth towards a higher ideal - that's the light of the sun. Afterwards, despite continuing to stay in the mud, it is well above the water surface and we do not associate beautiful lotus flower with the mud anymore because its beauty has nothing to do with its origins. Another related aspect is lotus leaves are very slick too. No water stays on them. Just rolls off.
So we can still be part of this world like a lotus flower. As long as we look up to a higher ideal and keep it constantly in our view, where we come from, what's our current state, what is the kind of world we are in, our life, all that is not going to matter. Like lotus, we will start tracing our life upwards towards the surface of the pond as long as we tune ourselves with the light of the sun. If we can also develop the nature similar to that of lotus leaves, even if worldly things get on us, they very easily roll of like the water rolls of from a lotus leaf or from the back of a duck.
Second example that Vedanta gives is that of butter.
You see, if you mix milk in water, it's gone. Becomes one with water instantaneously. It's not easy (if not impossible) to separate milk from water once you mix them together.
But, if you go through the hard work of slowly but systematically converting milk to butter, then after, even if you put that butter in water, it just floats in water. Butter will never become one with the water.
So one way to be in this world of water is to be like a butter.
Butter is concentrated milk. It's a prolonged and involved process to make butter from milk. The process transforms milk and takes it through several stages. Converting milk to curd may seem like poisoning it with bacteria, but that's what is needed before you can churn the curd to make butter. So are our lives. We may need to take some drastic steps which may seem somewhat harsh because without them we can not transform ourselves before we can comfortably come back and live in this world without being part of it. So if you have to take some unusual actions, you must, as long as they are going to help you transform milk to butter. Some of these actions may include how you spend time, with whom you spend time, is your lifestyle conducive to peaceful living, are you overindulging in sense pleasures, is your physical diet free of strong foods etc. etc. Basically point is - being very disciplined with lifestyle so that you can reach some stable state so that after which an occasional indulgence here and there is not going to throw you off the track. But it's going to be an arduous task but well worth your efforts.
As always, this kind of teaching is very elementary Vedanta. Probably primary school level. For people at higher levels, this may sound naive. But, that's the way even modern education works. For somebody in college, what you learned in primary school looks naive and silly but we know that we build our knowledge progressively. So is with Vedanta too. One step at a time. Using one truth to get to the next one. A little higher truth.