Trial and error specifies that you should guess the value of m and see if you aimed too low too high then adjust your next guess based on that.
Suppose we don't already know what m is (even though it is completely obvious), let's pick m to be 6,
So we check, [tex]7\cdot6=42[/tex] but [tex]35\lt49[/tex] which means m must be bigger.
So we pick m to be 8 and check, [tex]7\cdot8=56[/tex] but [tex]56\gt49[/tex] which means m must be smaller.
Since only natural number between 6 and 8 is 7 we pick m to be 7 and check, [tex]7\cdot7=49[/tex] and [tex]49=49[/tex].
The answer is therefore 7.
Hope this helps :)