Slider could not be found

why doesn’t unity recognize the word slider? am i just being dumb?

// paste code here

Your code should work for sure.

On your screenshot MonoBehaviour is not in green, maybe Visual Studio is not correctly setup to Unity ? Look in Preference/ExternalTools