Essentially the card details are asked to charge you if you don't turn up. At times it's just a deterrent, i.e. to stop people from making booking that they never plan to use. More often quite a few Hotels will not charge even if you don't show up.
What card details do they need?
Generally the Card Number and Expiry date are sufficient. Do not give anything more.
Will they be able to charge me anything on my card ?
That depends on the Merchant, country of jurisdiction, etc. Quite a few countries would allow such a charge. Quite a few merchants would be allowed such a charge.
I plan to settle the bill by cash
This if fine. You can change the mode when you check-in or more like when you check-out. You can use different card or pay cash.
How would they be able to charge me anything if I do not reveal my PIN code?
As mentioned earlier, it depends. PIN is a method of establishing that you authorized the charge. If the merchant has other means, for example he can establish that it was you who entered the details [and this was not fraud, etc] and authorized them to charge, they can still go-ahead can charge. There are certain cards where this would Never be allowed. Most others it would be.
Is it safe to give them my card details?
This goes to trust. If you think the merchant is reputable, then yes. Else no.