The preamble might be brief, but it is rich with significance and essential for understanding the foundation of each of the ten commands that follows. In these opening two verses, God expresses why He has the authority to give these commands to His people (He is the Lord their God) and why they should follow each one (what He has done for them). Why should the Israelites not have any other gods? Because God is the one true God; He is the One who created and sustains them. Why should the Israelites not steal? Because they have seen God provide so generously to them and should trust that He will provide all they need without needing to resort to taking from someone else.
Like the Israelites, we need to consider our obedience through this same lens: who God is and what He has done. Both are essential for us to remember, for both fuel the love and gratitude in us that is the proper motivation for our obedience. This is at the heart of the gospel: We do not obey God for His acceptance and love but rather from His acceptance and love bestowed upon us in Christ. What we do matters, but why we do it matters just as much.
What tends to be your motivation to obey God?