A belief in the hereafter is a belief in the afterlife, or life after death. It is, therefore, associated with religions and the soul's journey to heaven or to hell, whichever way being just deserts for the person based on how they led their life.
This is the shortened form of the full idiom, 'better the devil you know than the devil you don't', and means that it is often better to deal with someone or something you are familiar with and know, even if they are not ideal, than take a risk with an unknown person or thing.
This expression indicates a person's determined intention of getting a work done in spite of all odds he may face. He will use all and every means to accomplish the target. Example: He moved heaven and earth to get his literary work recognised by the committee of experts.