ANSWER: The Bible verse you are referring to regarding what it means to grieve the Spirit is in Ephesians 4.
29. Do not let any corrupt communication come out of your mouth, but that which is good and needful for edification that it may give grace to those who hear. 30. And grieve (Greek: lupeo, Strong's Concordance #G3076) not the Holy Spirit of God by which you have been sealed for the day of redemption. (Ephesians 4:29 - 30, HBFV throughout)
The Greek lupeo means to, 'cause pain, distress, to be sad or to grieve.' The Bauer-Arndt-Gingrich Greek-English lexicon states the word means, in context, to "vex, irritate, offend, insult."
The Bible teaches that the Spirit is NOT a person or the third entity in some sort of Trinity (see our article for an in-depth study). It is, rather, the power through which God (the Father and Jesus Christ) accomplish their will in the universe. How can we then insult or offend it? If we look at the context of Ephesians 4:30 we will find our answer.
Verses 17 to 22 of this chapter tell believers that they should not follow the foolishness, vanity, and lusts of their human nature as they did before they were converted. We are to be renewed in our minds (verse 23) through God's power (2Timothy 1:6). We are to become a new person (verse 24) through Jesus dwelling in us (Colossians 3:10 - 11). We should not lie. We are also not to let our anger get out of control, thereby giving the devil a chance to tempt us (verses 25 - 27). We are to not steal but rather work as God intended so that we can not only provide for ourselves but also have something to give to others (verse 28). We are not to use filthy language as the unconverted do but rather work toward building up others by what we say (verse 29). We grieve it, the Spirit, by engaging in the immoral actions Paul lists.
How serious is it?
How serious is it to grieve what God gives each person that makes him or her a TRUE Christian? Consider what Christ taught in Matthew 12.
32. And whoever speaks a word against the Son of man, it shall be forgiven him; but whoever speaks against the Holy Spirit, it shall not be forgiven him, neither in this age nor in the coming age (Matthew 12:32)
Why does God regard insults against the Spirit as worse than insults against Jesus? It is possibly because it is the means by which Christians are guaranteed eternal life IF they remain faithful to the end of their human existence. Its continued presence in our lives is necessary for salvation (2Corinthians 5:5). Paul tells us in Colossians 1:27 that the mind of Christ in us is the hope of glory or final salvation.
Whenever we sin, we grieve the Holy Spirit. God wants us to resist and avoid sin as much as possible. He will not withdraw or lessen his presence in us as long as we recognize our mistakes and weaknesses and repent. Our loving Father knows we are still human and subject to the flesh. He promises to forgive us if we ask him and to cleanse us of all unrighteousness (1John 1:7 - 9).