You can’t. You can’t legislate righteousness. You can make all the laws and rules you want that get people to do the right thing, but if no one’s heart is in obeying, then it doesn’t do much good, if any at all. At best you have lip-service and the appearance of goodness. Frequently you have people constantly disregarding the laws and rules with nothing to be done about it.
God Himself doesn’t force people to obey what He says. There are consequences for obeying and disobeying, but those are natural outcomes built into the concepts of obedience and disobedience. Why do you think human laws and rules work how they do? A law or rule states what you should or shouldn’t do and the consequences of disobeying, which are carried out by the proper authorities.
Even if you force someone to follow rules and laws, they will still go to Hell if they don’t believe in Jesus. Besides there is nothing humans can do by rules and laws to clean ourselves or others up for God. The law cannot save, only grace can. (Romans 3:9-20) Why do we think Jesus came in the first place? God is after the heart of mankind, not the lip-service or mere outward obedience.
God lets each of us decide whether we will obey Him and why. God wants our willingness, not our grudging presentations. God wants our hearts, not our outward conformity.