"And do not grieve the Holy Spirit" is Paul's instruction to the Ephesian believers. (Ephesians 4:30) If the Holy Spirit were simply a power or a force, and not a person, he could not be grieved. But the Holy Spirit is a person: he can be lied to (Acts 5:3); he can be resisted (Acts 7:51); he can speak (Acts 13:2); he can be insulted (Hebrews 10:29); he can be blasphemed (Matthew 12:31-32); and he takes personal care of God's people. (John 14:16, 26) Furthermore, he is holy.
When we sin, we grieve the Holy Spirit. We get an insight into how our sin affects him by considering how we ourselves grieve. We grieve at the death of a loved one; we feel a sense of great personal loss along with a depth of sorrow never before experienced. We mourn, we pine, and we lament. Similarly, when we sin the Holy Spirit is grieved by what we have done. Our sins are not committed in a vacuum; they affect the Holy Spirit. He is personally offended by what we do.
Paul's words "do not grieve the Holy Spirit" are found among instructions to put off the old self and put on the new self "created to be like God in true righteousness and holiness". (Ephesians 4:24) Paul itemises a number of sins that grieve the Holy Spirit, though his list is not intended to be exhaustive: lying, anger, stealing, unwholesome talk , bitterness, rage, brawling, slander and every form of malice. (Ephesians 4:25-31)
I believe Paul intends to do more than simply tell us not to grieve the Holy Spirit. I believe he wants to motivate us to have nothing to do with sin, since he reminds us that we were "sealed for the day of redemption" by the Holy Spirit. (Ephesians 4:30) By referring to the day of our redemption, Paul is taking our minds from our life here on earth to our eternal home with God in heaven. His remark is similar to what he told the Colossian believers: "Since, then, you have been raised with Christ, set your hearts on things above, where Christ is seated at the right hand of God. Set your minds on things above, not on earthly things." (Colossians 3:1-2) Do you see what Paul is doing here? He is saying to the Christians that since this is true - your conversion to Jesus – then a holy life must follow. He is exhorting us to become a heavenly-minded people. Our body is the temple in which the Holy Spirit resides. (1 Corinthians 6:19) Meditation on that glorious truth should motivate us to want to live a holy life. And we can because we have been given the Holy Spirit for that very purpose. (1 Thessalonians 4:1-8) When we "keep in step with the Spirit" (Galatians 5:25) not only will we not grieve him, but we will enjoy his holy fellowship. (2 Corinthians 13:14)