If any part or pivot is sticking, use a little penetrating oil to clean it, after you have scraped the bulk grease/dirt off.
Then clean the interior metal parts with brake cleaner or carburetor cleaner, following the manufacturer's instruction regarding protecting finished surfaces.
Blow dry with compressed air.
Use a dry lubricant spray. Do not use oil or grease!
https://www.lowes.com/pd/3-IN-ONE-3-...E&gclsrc=aw.ds
Re-install.
If the key does not work properly after cleaning the lock interior, you can try some penetrating oil in the keyhole, followed by cleaner, compressed air, and dry lube. However this does not treat all of the surfaces inside the cylinder and possibly it could make things worse by forcing grit further inside.
Many people use spray oil/grease lubricant into the keyhole when they have a problem. This is a short term fix that makes things worse in the long run. If the key cylinder is difficult to turn with the key after the treatment listed above, it might be best to get professional help, especially if you are not familiar the way it works. There are many parts that must be reinstalled in their exact same position.