Make a Cursor Disappear?

How would I write a script to make a cursor disappear when I press a key on my keyboard and then reappear when I press that key again?

Screen.lockcursor or Screen.hidecursor is what you are looking for.

Then simply make an if-statement:

if (Input.getButtonDown == "button") { //if you press this button
Screen.lockCursor = true; //locks cursor
}
if (Input.getButtonDown == "otherButton") { //if you press this button
Screen.lockCursor = false; //unlocks cursor
}