how to create a custom type in C#? public Atype atype;

Ive seen other people make there own types in scripts like this…

private AnotherScript anotherScript;
private YetAnotherScript yetAnotherScript;
private BoxCollider boxCol;

yet when i try to do this i get errors that they arent real types.
how can i make them usable types?

i want to do:

MyScript myscript = target.GetComponenet();

ScriptYouNeed script = target.GetComponent();
script.VariableToChange = SomeValue;


target.GetComponenent<ScriptYouNeed>().VariableToChange = SomeValue;