To get stains out, I make a solution of some oxygen bleach and a little water and apply it to the stain every ten or fifteen minutes or so, to see if it is helping. If it doesn't help, I put lemon juice on the stain; I follow roughly the same protocol, putting lemon juice on it every fifteen minutes or so (lemon takes longer to work than the oxygen bleach). Between these two treatments, I have so far been able to get all stains out.
If you use lemon juice, be aware that the lemon juice can actually stain the garment too, so either wash the jeans right away once the stain is out or else put some enzyme stain product on to make sure that the lemon juice will come out when you wash.