how do you make a Mouse ScrollWheel script

i want ot make a script where the camera will scroll in and out and also move freely (Iv added the FPS controller ) How would i do this?

Something along the lines of…

camera.fieldOfView += Input.GetAxis("Mouse ScrollWheel");

or

camera.transform.position.z += Input.GetAxis("Mouse ScrollWheel");