how to turn a GUI toggle on/off from a script

I am making a puzzle based game that has a toggle that needs to be in the “on state” after every level. How exactly should I do this?

This sounds like you could use the help of some tutorials. For example the Unity Learn Site about User Interface. You could work through one of the series like this one about a Tic-Tac-Toe game to get an understanding of how the UI system works.

I know that you’ve written “GUI”, so I should clear up, that GUI refers to the old legacy immediate mode GUI system of Unity, which shouldn’t be used anymore outside of editor scripting. Instead, we have the component-based UI system since Unity 4.6.

There’s a UI Toggle component to do what you want, once you understand how the system works. You want to set the isOn property.