What is effective kidney stone prevention?

I’ve had two 4-5mm calcium oxalate stones. Both have stayed with me 5 months, being stuck in UVJ for the last two months. —what can we do to PREVENT stones?? —HOW are people passing such big stones but some small stones have to be surgically removed? I drank 5 quarts of water daily with normal urine output. So glad to find this group where people understand the struggle!!