1. Clean and lube weapon per the TM with CLP.
2. Shoot quality known good ammo to test with. Assuming you have a NATO or Wylde chamber, and not some SAAMI match, use Q3131, Q3131A, Federal XM193/855, AE223, etc. Dont use Wolf, Monarch, or Barnaul for reliability testing.
3. Insert one round in mag. Chamber, and fire. Bolt should lock back. If it doesnt - you most likely have a gas leak, or binding.
Ensure you have all the correct components. Correct buffer, buffer spring, etc. Ensure your bolt catch works 100% when manually pulling CH back.
Work action back fully and feel for any rubbing or binding. Inspect upper receiver, carrier, and bubbfer tube for signs of rubbing/wear.
#1 gas leak/short stroke area is the carrier key. Ensure the key screws are tight, and staked. These get loose over time if not staked properly. Inspect gas rings on bolt - insure you have three installed.
Lastly - describe your rifle in detail. Type of stock, buffer, carrier, barrel, etc... and mags you are using.