I got confused after seeing the inductive definition of $L$-terms in model theory. So I do get that there are variables and constants, and when function $f$ is applied to the term, the resulting thing is also a $L$-term.
But what does this really mean? Let's say we have constant 1,2,3 and variable $x,y,z$. Let $f$ be $f = x*3*y+2*z$ where $*$ and $+$ is in $L$. Then does this mean that the whole $x*3*y+2*z$ is a $L$-term? Or am I being confused about what function is? (so I should only treat function as sets or something like that?)
You are a bit confused about what functions and function symbols are. The thing to keep in mind is that when you are defining terms, you have not yet assigned interpretations (i.e. meanings) to any of your symbols yet. Therefore, function symbols are not the same as functions. They are just symbols with an associated arity. Functions appear in model theory when you assign interpretations to the symbols in your language, but you are not there yet because you haven't even gotten to the point where formulas have been defined. Say our language has the variables $x$, $y$, and $z$, function symbols $*$ (binary), $+$ (binary), and $f$ (ternary), constant symbols $1$, $2$, and $3$, and relation symbol $=$.
Then constants and variables are terms: $1$, $2$, $3$, $x$, $y$, and $z$. To get more terms, for each function symbol we define a map from the set of terms to itself: $F_*(t_1,t_2)=*(t_1,t_2)$ (which we write as $(t_1*t_2)$ as a convention), $F_+(t_1,t_2)=+(t_1,t_2)$ (which we write as $(t_1+t_2)$ as a convention), and $F_f(t_1,t_2,t_3)=f(t_1,t_2,t_3)$. The set of terms is generated by applying the term building functions $F_*$, $F_+$, and $F_f$ repeatedly to elements in $\{$1$, $2$, $3$, $x$, $y$, $z$\}$. So, for example, $(x+z)$ is a term, $((x+z)*2)$ is a term, and $f(1,(x+z),((x+z)*2))$ is a term.