I have been playing guitar for more than 2 years and i have been anchoring all these while! I pluck with only my thumb and the index finger and the other 3 are resting on the guitar

I decided to change and not to anchoring too much or not at all. Is there any advice or practice for me to change this bad habit of mine?

Thanks so much!
I had the same problem. I just changed my pick and noticed that it was much better if i adjusted my fingers. I guess you could try that.
Quote by Jaymz_515
I pretend I'm a huge spider laying eggs, then when I flush the toilet I fall to floor screaming "MY CHILLLDRENN!! NOOOO!"

If you're flammable and have legs, you are never blocking a fire exit.
- Mitch Hedberg
try to include the other fingers while picking so you'll be less inclined to anchor. Other than that, just practice.
Use an elastic to snap the fingers together and close your hand in a fist-like fashion,worked good for me and a mate to get rid of anchoring in a few days.
There's no answer but to just do it. Man up and just consciously force yourself to stop. You don't need to float your hand three inches off the guitar, or even one inch. Just enough so that no part of your hand is actually fixed to the guitar. As long as you can move your hand at all times without one part of it staying attached to the guitar, you're fine. Your picking is going to feel weird, and you'll miss strings at first, and have horrible dynamics, etc. But give it a few days and it will start to feel very natural.