This is Dreamcatcher (2003).
One night, Jonesy sees Duddits beckoning him to cross the street, but
as he does so, Jonesy is hit by a car. His injuries heal with
mysterious speed, and six months later, he is able to make it for the
group's annual trip. Jonesy rescues a man lost in the forest named
Rick McCarthy. He is very ill, so Jonesy and Beaver let him rest and
recover inside their cabin. Suddenly, all the forest animals—predator
and prey both—run past their cabin in the same direction, followed by
two military helicopters that announce the area is now quarantined.
Jonesy and Beaver return to the cabin to find a trail of blood from
the bedroom to the bathroom, where Rick sits dead, covered in blood. A
three-foot long worm-like creature writhes and screams in the toilet.
Beaver sits atop the toilet lid to trap the creature, but the creature
breaks out and kills him. Jonesy tries to escape, but is confronted by
a large alien called Mr. Gray, who possesses Jonesy's body.
... [At the end]
Jonesy, now himself again, steps on the final alien larva before it can contaminate the reservoir.