Keep out of (somewhere) keep (someone or something) out of (somewhere)

To not enter somewhere, to not allow someone or something to enter somewhere.

The dog had to keep out of the garden.