Can I lose the Holy Spirit if I sin?

I am struggling with this question, I used to be Catholic, and in the catholic framework you can lose the holy spirit if you commit a mortal sin (sin of grave matter with full knowledge and consent). I am no longer Catholic, I am baptized, but I am afraid that if I sin I can lose the Holy Spirit, what is the Lutheran view of this matter?

Can a person have the holy spirit and then lose it? What are the conditions for that to happen?