If you read more online it’s actually a good sign that your baby is learning self soothe, and is a very common and normal self soothing action. They will grow out of it in time. But if you really think you want to stop it for any reason, you may substitute it with something else - because the baby will have to be soothed by some other ways.