How we die will show how we have lived.
By using discrimination we know the real from the unreal. God alone is Truth, all else is illusion, Maya. Knowing this truth is wisdom. The path to attain Truth is dharma.
All actions that take you closer to God are dharmic and all those that take us away from the path are adharmic, unrighteous.