Remember how our parents would teach us rules when we were young? Rules like not playing in the street or not playing with matches. Remember how sometimes the rules seemed like a burden, like our parents must have invented them to keep us from doing the things we really wanted to do—the things we thought would make us happy? As we grow up we learn how important these rules are, how we could have been seriously injured or even killed if we had not obeyed.
Like our parents growing up, God gives us commandments to help keep us focused on what is most important and how to stay safe. All of His guidance is meant to keep us safe, help us stay close to Him and, in the end, to give us more freedom and happiness.
The word "commandment" might make us think of the Ten Commandments—a list of "Thou Shalt Nots"—God does not only tell us what we should not do, but He also tells us what we should do. His greatest hope is for our eternal happiness, so we can be sure that His commandments are not restrictive rules, but they are divine guidance meant to protect us from harm and lead us to better ways of living.