Set Bool in Inspector to true or False

OK this should be simple but I always have rouble trying to do this. I have a script with options in the inspector that can be checked to on or of. I am trying to make a UI button call that will toggle the option in the inspector on or off, right now I can turn it on with my gobble button but always have difficulty trying to figure out how to turn it back off with the same toggle button.

public void Loop() {

		loop = true;

		
	}

Just use

loop = !loop;

So you set it to the opposite of what it currently is.

if Loop() is the method that the button is calling, just check:

public void Loop() {
 
         if(loop) // you can also write if(loop == true)
         loop = false;

         else
         loop = true;
 
         
     }