Know yourself first ,once that is accomplished then perform in this world whichever way you want.
This knowledge come from conviction and devotion. Once known it will not get established in an instance it needs constant efforts till intellect gets fully merged with the Self.
Then one will know that its the self which will leave this body mind complex. Self is being separated from rest gross form .
This will give lot of contentment because one knows he will continue even after the death .