setting the properties in the inspector

[ExecuteInEditMode]
public class Trap : MonoBehaviour
{
[SerializeField]
private bool trapTurnedON;

public bool TrapTurnedON
{
    get
    {
        return trapTurnedON;
    }
    set
    {
        Debug.Log("HERE");
        trapTurnedON = value;
        
    }
}
}

if I check or uncheck the bool in the inspector while or not while running the game Debug.Log doesn’t trigger. It only triggers when the bool is changed inside a script.

Any idea how to trigger it in the inspector?

The default inspector has nothing to do with the properties. They only serialize fields. So the bool toggle you see in the inspector is actually link to the trapTurnedOn. You see it as Trap Turned On is because Unity will format all the names in inspector like this.
To get want you want you can write a custom editor for Trap. Or make a something different like a context menu