Yes, God does know what we need; Jesus reminded His disciples that "your Father knows what you need before you ask him" (Matthew 6:8).
But often we don't know what we need! We may even think we don't need anything from God, because we think we're able to handle everything on our own. One reason we need to pray, therefore, is so we'll stop and realize just how dependent we are on Him. We also may think we know what God ought to do for us but we may be wrong. Our hearts need to be attuned to His will and this often comes only as we pray. The psalmist prayed, "Teach me to do your will, for you are my God" (Psalm 143:10).
Your question, however, points to another misunderstanding many people have about prayer. They think of prayer only as asking God for something but prayer is much, much more than this! Prayer, after all, is simply talking to God and when we pray, we should thank and praise Him for His goodness to us, and tell Him that we love Him. We also should confess our sins to Him, and ask for His forgiveness.
Remember that we can come to God solely because Jesus Christ has opened the way for us. In fact, even now He is praying for us. Have you given your life to Him? If not, let the first prayer you make today be one of confession and faith, asking Christ to cleanse you and come into your life and He will.