How do you destroy a gameobject from a different scene

I am pretty new to unity and don’t understand much of the code yet. I am making a game where when you complete a level a lock gets off that level so you can repeatedly play the level. The problem is I don’t know how to remove the lock from a trigger at the end of the level.

This is a bit dated but probably still relevant :

Short answer, you can’t do it. But you can determine which objects to destroy when the new scene loads.