What is the diffrence between Reference and GetComponent ?

in the both ways you can access the classes members i am confused ?

They are both technically a “reference” to the object, method or class, etc. The main difference (AFAIK) is when people talk about creating a “reference” they mean you define a public variable which can then be assigned a GameObject via the inspector. (That creates a “reference” your script can access).

Using GetComponent is the same thing but is done at run-time within your script.