How to turn on booleans in scripts and check if they are true in if statements?

I need help on how to enable or disable boolean variables in scripts and check if they are true or false in if statements.

To declare your boolean (This is C Sharp):

bool answer;
answer = true;

to test your bool value in an if statement

if(answer)
{
   //do what you want here when the answer bool is true;
}
else
{
   //do what you want to here if the answer bool is false;
}