What are you actually referring to ? What is your belief ?
When you write:
"I get how anyone can pick up parasites, but if the environment is clean and there is no food for them, I don't get why they don't die?"
When you say environment, are you referring to intestines, or to food or to something else ? I am not really sure I understand what you are referring to ?
Are you referring to intestines ?
If you are referring to people fasting on water only, for 40 days, drinking just water and no food for 40 days, I would assume that some of the intestinal parasites would naturally die during those 40 days and will be passed out with feces.
Beware, during those 40 days, human liver keeps producing bile, and bile is actually very nutritious food for liver flukes, who live inside bile ducts, and feed on bile.
So, you fasting may have no effect on liver flukes, as you will be producing bile continually, just not as much as when you eat food.
That is why people keep pooping while water fasting. What comes out is bile.
If you are referring to people who claim that eating vegan diet would somehow prevent parasite infections, you should know that all vegan animals have parasites.
Snail, grasshopper,rabbit, sheep, cow, kangaroo, horse, zebra, deer elephant, rhino, giraffe, buffalo, hippopotamus, gorilla etc. all have intestinal and other parasites.
Humans are omnivores, we can eat both animal based foods and plant based foods.
Our parasites are also omnivores, our parasites can also digest and live on anything we live on.
India has a huge population of vegan people.
India is also a country with a huge population of intestinal worms.
Worms don't care much if you are vegan or not.
If you are vegan, it may be very unlikely you get infected with pork tapeworm, or with fish tapeworm, or cow tapeworm, as getting infected with those worms would need you consuming pork or fish or cow, ..
But there are still hundreds of roundworms who's eggs are waiting on the plant based foods, or in water, or on your hands, waiting to to be swallowed.
Ascaris Lumbricoides, for example, is the most common round worm in the world, and infects both meat eaters and plant eaters. It is estimates that one out of 4 people in the world carries Ascaris.
Same with pinworms. Most people have had pinworms at least once in their lifetime.