Hi Mariam! I bent down to pet (or to pat) a cat are both correct... but I think 90% of people would say "to pet" rather than "to pat." To pet has a broader meaning: it means to give physical affection to an animal... by patting or caressing or stroking or touching them lovingly however you spontaneously feel drawn to do that. To pat is the very specific physical action of gently tapping a person's or animal's head or back with the flat of one's hand. So, petting a cat involves more touching options than patting a cat. One well known use of "patting" in English is... "you can pat yourself on the back"... which means you can congratulate yourself by tapping your own back a few times. With small animals, whether you say you are patting or petting them, you have to bend "down" to sound natural. Hoping this helps!
We might touch humans in similar ways that we touch animals, but we don't call it "petting!". We call it caressing, stroking, massaging etc. Petting is only for pets, which is the name we give to domesticated animals in our homes!