Variables Help

This may be a stupid question, but how do you get a variable from on lua file to another, so I can get it, and use it on a function or a piece of code?

Just declare a global variable and it can be used within another file.

Already tried, got nothing but a nil value.