Keep from (doing something)

To prevent or refrain from doing something.

I love ice cream and could not keep from eating three bowls.