Trying to access a variable from another script c#

Otherscript otherscript = GetComponent();

It says object is not set to an instance of an object or something, im fairly new to unity scripting and i am well aware that there is documentation on this but it doesn’t help or give an example for altering an integer with ++.

I explain it very clearly in these two topics.