Toggling a blinking led ON & OFF
Note, this is not an answer, but I want to show some code examples based on the comment:

You can use as said in the comment:


Remove '== true' in a boolean condition
Replace '== false' by '!' in a boolean condition


You will get this:

  // check if button state has changed
  if (newButtonState != oldButtonState) {
    // if button was pushed
    if (newButtonState == HIGH) {
      // check led state
      if (!ledState) {
        ledState = true;
        blinkState = true;
      } else {
        ledState = false;
        blinkState = false;
      }
      if (ledState &amp;&amp; blinkState) {
        newTime = millis();
        if (newTime - oldTime &gt;= 250) {
          state = !state;
          oldTime = newTime;
        }
        digitalWrite(redLed, state);
      }
    }
  }
  oldButtonState = newButtonState;
}


About the following fragment:

  if (!ledState) {
    ledState = true;
    blinkState = true;
  } else {
    ledState = false;
    blinkState = false;
  }


Since you write ledState and blinkState in both clauses, and the condition is simple (so you don't need to put it in a temporary variable, you can replace this fragment by:

blinkState = !ledState;
ledState = !ledState;


Note you have to reverse the order as blinkState depends on ledState.