Eat fewer oxalate-rich foods. If you tend to form calcium oxalate stones, your doctor may recommend restricting foods rich in oxalates. These include rhubarb, beets, okra, spinach, Swiss chard, sweet potatoes, nuts, tea, chocolate, black pepper and soy products.