One should almost never use a debit card, as if it gets compromised the money comes directly out of your account and the banks don’t have much incentive to help too much.
With a credit card, that stolen money belongs to the bank, and therefore they have a big incentive to get it back, so using this kind of card allows you to wield the power of a large company for your benefit. As long as you pay off the full bill every month, you are getting this protection for free.