Offering condolences feels awkward for many of us, and most of the time it's not because we're too overcome with grief. It's because we don't know what to say — or whether we should say anything at all. The point of expressing your sympathy is to share with those who are grieving that you're thinking of them and that you share in their loss.
Although you may or may not wish or be able to attend the visitation and funeral, depending on your relationship to the deceased (and your own level of comfort), extending condolences can be as easy as sending the grieving family or friend a card or letter. But this is a time when you should skip modern technological conveniences. Make it a handwritten note. By no means should you send your sympathies with an email, text message or tweet. It's OK to keep it short, just as long as you keep it sincere. If you're close with someone who has experienced a loss, reaching out via technology is fine, but you should still send hand-written condolences.
And for those who are grieving, reciprocity is in order. Proper etiquette recommends you thank each person who extended their support and kindness. All these niceties may seem overly formal in the modern world, but they soothe emotional pain and reinforce a sense of community.