You can keep trying a level as often as it takes, and you won't be penalized for it. Spend a few quick rounds in any difficult new level. Look at the various hazards and the candy positions, and figure out how they will all interact. That will go a long way towards helping you settle on a working strategy.
Multiple Solutions Work
Don't waste all of your time trying to find some perfect solution. Always try different approaches and see what works most easily for you. If a technique is getting you about halfway there, try something else dramatically different and see if it quickly gets you all the way. And don't be afraid to rely on luck sometimes.
Revisit Past Failures
As you advance, you might sometimes find yourself running up against a wall. If a stage gives you too much trouble for an extended period of time, see if there are any older levels that you can profitably revisit for additional candy that you might have missed the first time around. Time away from the current catastrophe can give you new ideas, and the visit to old territory might let you nab precious treats that previously evaded your grasp.
Transformative Power
Om Nom can transform into a variety of shapes, and each shape has a different power. It's a good idea to experiment with those powers, until you're familiar with their strengths and limitations, because often--though not always--you'll need to transform to one shape or another in order to snag candy from hard-to-reach places.
Various General Tips
There are usually a number of solutions in every level, so take your time and think of your own. Do a couple of trial runs first, just to see how everything behaves in the level and to get the feel for it. If you don’t think that you need to transform into an animal to complete the level, it might still be necessary to get three stars. In order to unlock new worlds, you need to get a certain amount of stars. If you feel you can’t move forwards anymore, go to an earlier level and get some more stars. Use the bubbles to lift up objects or even Om Nom in his original form.