The Sermon on the Mount (Matthew chapters 5-7) and the Sermon at the Temple (3 Nephi 12-14) is the blue-print for how to achieve salvation; how to obtain faith, spiritual gifts and gain an assurance of our exaltation by revelation. In other words it is how we become like the Savior.
It contains commandments to pray for our enemies, those who maliciously hurt and abuse us. If someone brings a lawsuit against us, we are to give what is asked an more. When sued, we are often not asked for our coat, but a substantial financial amount that may impoverish us. Perhaps this is one reason he said “And Jesus saith unto him, The foxes have holes, and the birds of the air have nests; but the Son of man hath not where to lay his head.”
Joseph Smith reiterated that this kind of sacrifice is necessary to obtain faith.
“Let us here observe that a religion that does not require the sacrifice of all things never has power sufficient to produce the faith necessary unto life and salvation. For from the first existence of man, the faith necessary unto the enjoyment of life and salvation never could be obtained without the sacrifice of all earthly things. It is through this sacrifice, and this only, that God has ordained that men should enjoy eternal life. And it is through the medium of the sacrifice of all earthly things that men do actually know that they are doing the things that are well pleasing in the sight of God. When a man has offered in sacrifice all that he has for the truth’s sake, not even withholding his life, and believing before God that he has been called to make this sacrifice because he seeks to do His Will, he does know, most assuredly, that God does and will accept his sacrifice and offering and that he has not sought nor will he seek His face in vain. Under these circumstances, then, he can obtain the faith necessary for him to lay hold on eternal life.
“It is in vain for persons to fancy to themselves that they are heirs with those, or can be heirs with them, who have offered their all in sacrifice, and by this means obtained faith in God and favor with him so as to obtain eternal life, unless they in like manner offer unto him the same sacrifice and through that offering obtain the knowledge that they are accepted of him.
“It was in offering sacrifices that Abel, the first martyr, obtained knowledge that he was accepted of God. And from the days of righteous Abel to the present time, the knowledge that men have that they are accepted in the sight of God is obtained by offering sacrifice….
“Those, then, who make the sacrifice will have the testimony that their course is pleasing in the sight of God. And those who have this testimony will have faith to lay hold on eternal life…But those who do not make the sacrifice cannot enjoy this faith, because men are dependent upon this sacrifice in order to obtain this faith. Therefore, they cannot lay hold upon eternal life, because the revelations of God do not guarantee unto them the authority so to do; and without this guarantee faith could not exist.
“All the Saints of whom we have account in all the revelations of God which are extant obtained the knowledge which they had of their acceptance in his sight through the sacrifice which they offered unto him. And through the knowledge thus obtained, their faith became sufficiently strong to lay hold upon the promise of eternal life and to endure 'as seeing him who is invisible' (Heb 11 :27). They were enabled through faith to combat the powers of darkness, contend against the wiles of the adversary, overcome the world, and obtain the end of their faith, even the salvation of their souls.
“But those who have not made this sacrifice to God do not know that the course which they pursue is well pleasing in his sight. For whatever may be their belief or their opinion, it is a matter of doubt and uncertainty in their mind; and where doubt and uncertainty are, there faith is not, nor can it be. For doubt and faith do not exist in the same person at the same time. So persons whose minds are under doubts and fears cannot have unshaken confidence, and where unshaken confidence is not, there faith is weak. And where faith is weak, the persons will not be able to contend against all the opposition, tribulations, and afflictions which they will have to encounter in order to be heirs of God and joint-heirs with Christ Jesus. But they will grow weary in their minds, and the adversary will have power over them and destroy them.” (Lectures on Faith, Lecture 6)