How do debit cards work?

I know nothing about these things (yes I’ve googled) but I want insight from actual people who use cards. Same with credit cards, how does it all work?

Thanks