What it means
It means to give you that cosy little glow inside, that feeling of comfort and happiness when something properly sweet or kind happens. You can use it when a nice gesture, a heartwarming story, or a lovely moment makes you feel all warm and fuzzy.
Usage examples
"That little old lady singing to her cat warmed the cockles, it did."
"Seeing the whole street come together for the charity bake sale really warmed the cockles."
"It warms the cockles when you get a handwritten letter from a friend."
"Watching the kids open their Christmas presents really warmed the cockles."
"The nurse's little note warmed the cockles of everyone on the ward."
Where it comes from
The cockles of the heart were thought to be the ventricles, from the Latin cochleae cordis, because the heart's chambers kind of look like cockle shells. And the warm part just adds that feeling of comfort. So warming the cockles is basically making your heart all snug and content.