For purpose of simplicity consider two $\mathscr{L}$- structures $M_1$ and $M_2$. Then direct product between $M_1$ and $M_2$ is also a $\mathscr{L}$-structure and has domain and constants, functions, relations.
I have two questions concerning this. Firstly why the product is also a structure?
I am unable to see any intuition behind it's definition. So i request atleast one example for my clarifications. For instance how is a function defined here??
The functions are defined coordinatewise, so for $a\in M_1, b\in M_2$, $f^{M_1\times M_2}(a,b)=(f^{M_1}(a),f^{M_2}(b))$ (this is for an unary function, for functions of higher arity, the definition is analogous. For unary relations we have $R^{M_1\times M_2}((a,b))\iff R^{M_1}(a)\land R^{M_2}(b)$, and likewise for relations of higher arity.
This is completely analogous to the way finite direct products of rings, vector spaces, modules, groups, and other algebraic structures are defined.
For example, $\mathbf R\times \mathbf R=\mathbf R^2$ is all three of the above.