Now you are free from your slavery to sin, and you have become slaves to righteous living.
Rom. 6:18 NLT
God does not need us in the sense that he is lacking something. God is sufficient and complete in himself. Sometimes it is said that God created us because he was lonely. God needed a love relationship, and therefore, God made us for companionship. Yes, our relationship with God is one of love, but that love is an overflow of the eternal love relationship found between the members of the Trinity: Father, Son, and Holy Spirit. God did not create us because he was emotionally needy for he already had a complete and fulfilling love relationship within himself (John 17:23).
The Bible does not directly answer the question, Why did God create anything at all? but it does let us know what some of the most glaringly wrong answers to that question would be. It would be wrong to say that God created because he was lonely, unfulfilled, or bored. God is free from that kind of dependence.
Fred Sanders, Deep Things of God: How the Trinity Changes Everything.
God needs us in the sense that we are representatives of his kingdom called to reach out to a hurting and lost world (1 Cor. 12:12-13). God needs us to display in our lives and actions the character and nature of Christ (1 John 4:9). God wants to operate in and through us as instruments of his love, mercy, grace, and forgiveness (John 17:25-26).
“Yield your members as instruments” (Rom. 6:18)–your bodies, your bodily members, your mental faculties. God needs your eyes, through which to look out with compassion upon the world; with a compassion that will care enough, it may be, to go, to speak, or to pray. God needs your feet, to carry the message of His concern and the message of His grace. God needs your hands, to toil, and by their touch reveal His love. God needs your lips to speak for righteousness and truth. God needs your heart, to throb with concern and compassion. God needs you. Where are the instruments in the hand of God?
George E. Duncan, “Responsive Surrender to God’s Will,” Daily Thoughts from Keswick: A Year’s Daily Readings, ed., Herbert F. Stevenson (London: Hodder and Stoughton, 1980), 322.