When Jesus was here on earth, He instructed us to carry out two ordinances: Baptism and the Lord’s Supper.
The Lord's Supper was instituted by Jesus during His last Supper with His disciples (Matt 26:26-29; Mark 14:22-25; Luke 22:14-20). 1 Corinthians 11 also describes the Lord's Supper in detail as Paul instructs the church on what it is and the right way to partake. It is described as a remembrance of what Jesus did on the cross (11:24), a symbol of the gospel (11:26), a symbol of our unity with others in the church (1 Cor 10:16-17), and an act that anticipates the return of Jesus and our reunion with Him (11:26). We're not told how often the NT church partook of the Supper, but it seems it was weekly (11:18), and the early church after the close of the NT seems to continue that pattern.
When it comes to the Lord's Supper, one of the main questions that arises is who may partake of the Lord's Supper. Paul said that "many of you are weak and ill, and some have died," because they did not eat and drink in a discerning way (11:30). Stated simply, Member’s in good standing in a gospel-proclaiming church may partake of the Lord's Supper.
We want to make sure that we are not harboring secret sin in our lives as we come to the table - this would be an affront to the one who died to free us from sin and death (We are in good standing and have a clear conscience).
We also want to make sure that we are a part of the body of Christ, since this is one of the symbols of the Supper - union with fellow believers. This means that we should be members of a local church in order to partake of the Supper (if we haven't covenanted together with other believers in church membership, would it be right to say that we are one with them and committed to them as we take the Lord's Supper?).
And not just members of any church, but members of a true church - which is a church that believes and proclaims the gospel.
In addition, since Baptism is a prerequisite to church membership, only those who have been baptized may take the Supper.
The bread and the cup remind us of His death on the cross as a substitute for our sins. Everytime we take the Supper together, we are reminded of the great punishment that our sins deserved, and the great love that Jesus showed by His willingness to substitute His life for ours. We are reminded of the unity that we have with our fellow believers - that people who otherwise might have nothing in common now share the deepest bond imaginable because they have been adopted into the family of God and are made to be brothers and sisters in Christ pursuing the same Lord. It is no wonder that Jesus has given us this way to remember Him as we gather together in worship.
If you want to look into this topic further, this idea of who can take the Supper is called "Close Communion." Other positions on this topic include "Open Communion," and "Closed Communion."