Activate line just one time

Hi , I need help.
How can I activate a line just one time , until the “if” changes , like a GetKeyDown but for vars, for example(JS);

example: boolean;

function Start () {
example = true;
}

function Update () {
if(example == true)
	{
    //I need this Log shows in the console just one time, until I change to false
    //And true later
    //Like press GetKeyDown to do only a thing each time
	Debug.Log("Just one time");
	}
}

If I use this script, the Log repeats every time it is read. Probably this can be the easier question you’ll see today, but I rlly need help!

Is this what you mean?

 if(example == true)
         {
         example=false;
         
        if( Input.GetKeyDown( KeyCode.Space ) )
         example=true;
         
         Debug.Log("Just one time");
         }