Suppose that the number of students is S, then I can see how to find the number of cookies in two ways.
If each student takes three cookies, there are five cookies left,
that is the number of cookies is 3S + 5
If each student takes four cookies, they are two cookies short,
that is the number of cookies is 4S - 2
At this point I see two ways to complete the problem. The first is algebraic, that is solve
3S + 5 = 4S - 3 for S.
The second method is to use a table to try various values of S and see when the two expressions give the same value. Here is what I mean
||3S + 5
||4 S - 2
Try some other values of S to see when the second and third column give the same value.