He that keepeth the commandment keepeth his own soul; but he that despiseth his ways shall die. –Proverbs 19:16 KJV
The are two ways to take this verse. Both are simple.
Don’t break the law.
Obey laws, and things should go well in your life. Break the law, and you will suffer the consequences.
Obey God’s Law.
Jesus said unto him, Thou shalt love the Lord thy God with all thy heart, and with all thy soul, and with all thy mind. This is the first and great commandment. And the second is like unto it, Thou shalt love thy neighbour as thyself. On these two commandments hang all the law and the prophets.
Matthew 22:37-40, KJV
If you truly want to keep your soul, love God and love others.
The Bible explains how. Read it.