One of the most basic principles in life is cause and effect. When you do X, you get Y. It’s true for bad things: when you commit a crime, you risk going to jail. And for good things: when you maintain your car, it lasts longer.
The same is true in our relationship with God. There are things where God says, “When you do X, then I will do Y.”
He says it to Adam and Eve and says, “When you stay away from this tree, things will go well for you.” He says to Noah and says, “When you build a boat to these specifications, then I will save you.” He says to Abraham, “When you trust me, then I will make you father of many nations.” To Moses, “When you follow me, then I will lead my people out of slavery through you.”
Jesus says, “When you seek me, then you will find me. When you knock, then the door will be open to you. When you ask, then it will be given to you. When you remain in me, then you will look like me.” God seems to operate on this principle: when you do X, I will do Y.