Hint- For solving we just assume the number of girls and boys in terms of some variables and proceed further.
Let the number of girls in the class is $x$ and the number of boys in the class is $y$.
It is given that there are a total of ten students in the class so:
$ \Rightarrow $ Number of girls$ + $ Number of boys$ = 10$
$ \Rightarrow x + y = 10$
Also it is given that the number of girls is $4$ more than the number of boys.
$ \Rightarrow $ Number of girls$ = $ Number of boys$ + 4$
\Rightarrow x = y + 4 \\
\Rightarrow x - y = 4 \\
Hence the two algebraic equations representing the given situation are:
x + y = 10 \\
x - y = 4 \\
Note- In most of such questions when two or more variables are unknown algebraically solving the question by assuming some variable is the best way to solve the question. As in the above case we have got two equations and these equations can be solved easily in order to find two unknown variables.