Everyone in the Church of God, every truly converted member having God's Holy Spirit, has made a commitment to God to obey His spiritual law, summarized by the ten commandments, in the spirit and the letter. And we strive to keep that commitment.
We fall short. We have to struggle against our human nature. Paul describes that struggle, using himself as an example.
"For what I am doing, I do not understand. For what I will to do, that I do not practice; but what I hate, that I do. If, then, I do what I will not to do, I agree with the law that it is good. But now, it is no longer I who do it, but sin that dwells in me. For I know that in me (that is, in my flesh) nothing good dwells; for to will is present with me, but how to perform what is good I do not find. For the good that I will to do, I do not do; but the evil I will not to do, that I practice. Now if I do what I will not to do, it is no longer I who do it, but sin that dwells in me. I find then a law, that evil is present with me, the one who wills to do good. For I delight in the law of God according to the inward man. But I see another law in my members, warring against the law of my mind, and bringing me into captivity to the law of sin which is in my members. O wretched man that I am! Who will deliver me from this body of death? I thank God—through Jesus Christ our Lord! So then, with the mind I myself serve the law of God, but with the flesh the law of sin" (Romans 7:15-25).
We all struggle against sin. And it is useful, in times of temptation, to remember the reasons for our commitment to obey God's spiritual law. We need these as motivations to resist temptation and obey God.
One motivation that Mr. Herbert W. Armstrong emphasized is that obedience to God's law brings blessings, and sin - the violation of that law - brings curses. As he put it, if we break God's law, it breaks us. There are always penalties involved in breaking God's law, and Mr. Armstrong also said, you cannot cheat God out of the penalty. Sin brings penalties of suffering, for ourselves and others, and if not repented of and turned from, death.
Obedience to God's law brings blessings in this life, and disobedience brings penalties. So for example, if we obey the commandment that says, you shall not commit adultery, our marriages will be happier. If we don't murder and steal, we have a better chance of staying out of jail. Those are good motivations to keep God's commandments. His commandments are for our good.
But obedience to God's law does not always bring happiness in this life. Sometimes we suffer for obedience. People who keep the Sabbath or refuse to lie for their bosses may lose their jobs. If we keep God's commandments, we may suffer persecution. Sometimes God tests our faith with suffering as He tested Job.
Remember the parable of Lazarus and the rich man. Lazarus must have obeyed God because he ended up in God's kingdom with Abraham. Yet he suffered miserably in this life. In the parable, the rich man was told, "Son, remember that in your lifetime you received your good things, and likewise Lazarus evil things; but now he is comforted and you are tormented" (Luke 16:25).
Paul, though he obeyed God's commandments, suffered in this life, along with many other servants of God (1 Corinthians 15:19, 2 Corinthians 11:23-33, Hebrews 11:32-39).
But the main fulfillment of the blessings of keeping God's law will be in the resurrection and in the kingdom of God. "For I consider that the sufferings of this present time are not worthy to be compared with the glory which shall be revealed in us" (Romans 8:18).
So a motivation for obeying God's law is possible blessings in this life. But a greater motivation is the blessing of being in the kingdom of God after the resurrection.
But there may be a greater motivation than either of these. We should want to please God and do His will for His pleasure and glory.
Our relationship with God must be based on love. That is built in to God's commandments, for the first and greatest commandment is that we love God with all our heart, soul, mind, and strength (Deuteronomy 6:5, Matthew 22:37-38, Mark 12:30, Luke 10:25-28). We should love God because He first loved us (1 John 4:19).
That love towards God should motivate us to please Him by obeying Him. "If you love Me, keep My commandments" (John 14:15). "He who has My commandments and keeps them, it is he who loves Me. And he who loves Me will be loved by My Father, and I will love him and manifest Myself to him" (John 14:21).
We should also fear God, and this should motivate us to obey Him. "Let us hear the conclusion of the whole matter:
Fear God and keep His commandments,
For this is man’s all"
"In mercy and truth
Atonement is provided for iniquity;
And by the fear of the Lord one departs from evil"
"But I will show you whom you should fear: Fear Him who, after He has killed, has power to cast into hell; yes, I say to you, fear Him!" (Luke 12:5).
God wants obedience to His holy law, but He wants that obedience to be based on a relationship with Him. God wants relationship-based obedience. God's whole plan shows this. His sacrifice of His Son Jesus Christ shows the kind of loving relationship God wants to have with us. It is a relationship that will carry on into the kingdom of God and prepare us to be full members of His divine family for eternity.
So to be motivated to obey God's law because obedience brings blessings, sometimes in this life, but totally and definitely in our future eternal life in the kingdom of God, is a good motivation for resisting temptation to sin. But to obey because we want and treasure a close relationship with God and seek to please Him is a better motivation, I think.