You need to already know some things like, for example:
variable - a changeable value or set of values stored in memory with an associated name
constant - a non-changable variable
function - a grouped set of instructions to be executed
object - (refered to as "frame" in WoW) a "black box" containing variables and functions
and a lot more, before you can begin to understand how to code.
If you have a basic understanding of programming, then you might want to look at Ten Ton Hammer's
UI Mod guide
If you can't follow that, then I strongly recommend a course in basic programming.
Good Luck!