Both definitions are correct.
视: treat ;归: returning home. to treat death the same as returning home. To describe being fearless in the face of death. Refers mostly to bravely sacrificing oneself for a righteous cause.
They also give an example sentence:
A, more literal, translation would be something like:
Facing the butchers knives of the enemy, the martyrs to the revolution treated death as returning home, righteousness abounds.
Another translation you can have a look at from A Chinese-English Dictionary:
刘胡兰临刑时, 大义凛然, 视死如归。
Liu Hulan faced the executioner's ax with a fortitude that commanded admiration and respect.
This phrase is mostly seen in connection with martyrdom and warfare.
Some other definitions that might help:
face death unflinchingly
meet one's death like a hero
1 to view death as a return home
2 to not be afraid of dying
3 to face death with equanimity (idiom)
I doubt you'd ever use this phrase to console anybody, even if you did it'd be strange unless they were dying for some big cause or fighting in a war.
There is an antonym: 贪生怕死 which CC-CEDICT defines as:
1 greedy for life, afraid of death (idiom); craven and cowardly
2 clinging abjectly to life
3 only interested in saving one's neck