It is important to focus on DOING what God has commanded us to DO so that we can AVOID doing what God has commanded us not to do.
This doesn’t obtain or secure our Salvation for that is a free gift, but to lead a truly repentant life, one must obey God’s commandments. Jesus tells us in John 15 that he is our friend. We don’t become friends out of our own merit even with our earthly friends; we are simply drawn to them. We do obey each other. We avoid doing things each other finds uncomfortable and we do things for each other out of love, at least in healthy friendships. Therefore to truly be a disciple and friend of Jesus, we must obey Him.