How can i execute a command which is stored in a varible?

an example is making a program that the user can write commands in a textbox and the computer will execute them.

(i am not making this program but i'm using it as an example. it wouldn't be a good program anyway)

could somebody help me please?