What can be done with Credit or debit card informations asked by websites?

Many websites ask for payment by entering information from Credit card such as VISA card/ Mastercard etc. Now, till date I knew that I should never tell anybody about these numbers. Then why these websites ask for credit card details and if (suppose) any of them have a malicious intent, then what can they do with these numbers?

Basically my question is, how it is being ensured that they will take the specific amount of money/ cost upon my consent; and without my consent they will not take money? Will the bank send me some verification code to my phone?

I never yet used online transactions and I am very confused to understand its steps, do’s and don’ts etc. I have searched Google and Quora but I didn’t find anything helpful.

I would be thankful if anyone can explain how this specific online transaction mode (by entering credit/debit card number) works and how an without-consent-transaction is prevented, preferably via a flow chart.

Many thanks in advance.