I feel much safer using my credit card on a site I trust and have ordered from before, as opposed to handing it to someone in person. I've done plenty of shopping online without issue. As Zero mentioned already, there is encryption there. I know it's not perfect,but it's harder for someone to steal your info that way than it is for a person taking your credit card in person and stealing your number in various ways (simply remembering the number, writing it down, making a quick impression, scanners, etc.).
Even walking around with your cards in your pocket, you are putting your info out there. There are scanners out there that can pick up your card and steal the info if you're in the right proximity of the person operating it. If you want to deal with that, you have to get one of those wallets that blocks such scanning. They're listed as RFID blocking billfolds and similar names.
One thing I do online is try to us Paypal as much as possible for payment. A lot of sites accept Paypal as payment. Which means, they don't get your credit card information, the deal is handled by Paypal. It's free to use Paypal to buy. However, if you accept payments from someone using Paypal you will be charged a fee. Anyone who has ever sold anything on eBay is familiar with that already I'm sure. So the seller gets the fee, not the buyer.
NEVER give out any info over the phone or through email regardless of who the people say they are or how official it looks. Just don't do it.
Anytime you see something pop up on your screen that says you have a virus, etc. etc. and wants you to click something make SURE it's your anti-virus software telling you that. I say this because many viruses load onto your computer pretending to be ant-virus programs showing up some phony threat. Then you click it and it gives you the virus. Sometimes the only way to get out of these is to shut the computer off immediately.
Another really good free program to help protect your computer is Malwarebytes. A search should pop it up. After some glowing recommendations I decided to try it out and have been using it for a while.