Credit cards
Credit cards are a relatively safe way for lenders to encourage public borrowing while making purchases - that way, they can make a profit.
Stores - possibly getting a commission - often offer credit cards (with attractive terms) under their brand-name to their customers; but they are actually managed by banks.
The necessary infrastructure is managed by one of a handful of companies - like Visa, MasterCard, AmericanExpress etc..
Advantages to customer
You earn reward points, which often correspond to 1 cent per dollar spent; with spendings in certain categories earning greater reward points. Reward programs have minor differences: rewards could be up to 5 cents per dollar spent in certain (often rotating) categories.
You have some protection in case of dispute with merchant.
You get some travel/ vehicle rental/ purchase related insurance benefits.
Official expenses
Consider getting a Diner’s club or an american express card, which usually allow more delay in credit repayment so as to accommodate dealys in reimbursement.
Debit cards
It is best to avoid using a debit card online - in case of fraud/ misuse due to details being leaked by a merchant, you can loose money in the bank account - if only temporarily.
Intermediate services
Services like Paypal ensure that credit card/ bank account information, which can potentially be misused, does not reach the merchant - instead, for a fee from the merchant, these services collect money from the customer and pass it over to the seller.