Apart from things directly in the C# language - keywords, primitives, and the like - everything else you make use of is either written by you or has to be referenced to bring it into scope.
So “float” for example it’s fine with, this is a language definition.
“Text” or “Monobehavior” for example do not belong to the C# language. To bring those in you have to have the correct references, which are done with “using” statements at the top of the file.
E.g. (from one of my monobehaviors of old that has Text and other items in it):
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System.Text;
public class ScoreDisplay : MonoBehaviour
{
public Text[] scores;
public Text[] frameTexts;
...
Note that without lines like using UnityEngine;
at the top, your code editor (and C#) don’t know what a MonoBehavior is, so it will underline it in red. Same goes for having using UnityEngine.UI;
so that it knows what a Text is, and so on.
Get started with that, and maybe using System;
as well, and see how many of the reds that gets rid of for you (hopefully most!).