PUNISHMENT IS NOT THE SOLUTION, QUITE THE CONTRARY
Punishment is part of the learning process and officially means 'to make behaviour diminish'. There are different types of punishment, forms we never want to use and other forms we need to change unwanted behaviour.
The form of punishment we never want to use is physical and invasive punishment, such as using the water hose, scaring the cat, shouting, physically pushing the cat away, etc. We call this invasive punishment. This is what we call invasive punishment and it is best to NEVER use it as it works with fear and anxiety and that is not what you want. Unfortunately this is the most common form of punishment.
The form of punishment we can use is called 'mild' punishment, and it allows the cat to decide at her own pace that something is not 'so cool', or 'not a good idea anyway', or 'not worth it anyway'. You do this, for example, by removing the reward factor until the cat does what you want, or by making something unpleasant.