How to stop accelerometer when my object touches the plane/ground?

How can I stop my accelerometer when my object touches the plane or ground?

Please help, thanks!

Create a bool variable for example isTouchingGroundOrPlane;(You can make it shorter sure)

and to where the accelerometer works put an if(isTouchingGroundOrPlane == false)
then it can happen.
else it cannot happen.

and tag your platform (Plane/ground or whatever it is) and when it does a if(collider.tag == “Tag That You Put”) isTouchingGroundOrPlane = true