You don't say what brand or model you're having a problem with, but generally, if you're getting the symptoms you've described, then there's not really anything you can do.
Either there is dirt inside, or the mechanism is worn.
If you have access to a clean, dry compressed air supply it might be worth blowing it out, but at a low pressure. If you're going to try this, it MUST be clean and dry air.
If you get any oil, dirt or liquid inside the lens, then there is nothing else you can do.
Please don't consider spraying any lubricant inside, as that would coat the inside surface of the lens and make things worse.
Basically, if blowing it out doesn't sort it, it's going to get expensive!