Safety can only be flipped to "safe" if the hammer is cocked.
You can see this by removing your upper from your lower. *Note: DO NOT pull the trigger and let the hammer just drop and hit the receiver. Gently ease it down. You can cock the hammer manually by pushing it back and down until it catches. Then you can activate the safety.
While your rifle is fully assembled (with no magazine in it, no round in the chamber), you can lock the bolt back by pulling the charging handle fully to the rear, and pressing on the lower half of the bolt release lever on the left side of the rifle.
Use the left hand to hold the rifle around the magwell. Use the right hand to pull back the charging handle. Use the left thumb to push in on the lower half of the bolt release lever. It's just a tiny round nub. Slowly release the charging handle while you keep that nub pushed in and you should feel the bolt catching.
If you're only concerned about flipping on the safety, you don't have to bother with locking the bolt back only to release it. Just fully rack the charging handle, that will pull the bolt back and cock the hammer, and then when you release, the bolt will close, hammer will stay cocked, and you can flip the safety.