Genesis 2:16-17 NLT

It strikes me that God's first commandment was given in a warning. He warned Adam not to eat from the tree because God knew what would happen if he did. It wasn't an arbitrary rule or a meaningless test...but rather a warning from a concerned father aimed at protecting his children from harm.

He was trying to protect Adam...as he does with all his laws, all his rules for his children.

They are meant to protect us, to ensure a better, more fulfilled life.