Setting classes to variables

Im making a game and i want ti know how you would set classes to variables. im sorry if this is a stupid question but im new to sort of new to RPG maker. i have a custom menu and a class and class change option but i dont know how to set classes to variables.
If this is what i think, then properly it would be done like this:
Code:
var myVar = null;

//*** some other things ***\\

myVar = new Class_Name();

then you have access to all classes methods:
Code:
myVar.

after dot in console you will see the list of all available methods and functions inside class.

Original thread: https://forums.rpgmakerweb.com/threads/setting-classes-to-variables.140265/