After removing all ammo from the gun & making certain that it is Safe,
Clean it...making sure all oil is out of the chamber...
as heat + pressure + oil = Glue
Second, check the chamber for a burr with a Qtip...if it pulls hairs out, you've gotta burr.
DIY or take to a gunsmith for repair.
Third, check the slide & rails for burrs...if so, DIY or take to a gunsmith for repair.
Fourth, check the ammo...
Fifth, check the extractor/ejector...fix/replace if bent/broken/etc...
Sixth, remember to tell us Which Kind of Gun & What Kind of Ammo,
as some have congenital defects that are very well known...