Wild cats separate their bathroom sites from their eating and drinking sites to prevent bacteria from getting into their food and water. In fact, they prefer to drink away from their food, to make sure bacteria from their meal (like a dead bird) doesn’t mix with their water. So, separate your cat’s food, water and litter box locations to help prevent issues.
However, if your kitty does go outside the box, put their water and food bowls on top of the inappropriate spot; it can stop them from associating the location with the bathroom — and therefore, stop them from repeating the behaviour.