What's the best way to solve functions? I can do basic ones, but have trouble with the harder ones.

I'm having trouble with the following:
Inputs x 1, 2, 3, ?
Outputs y 0, 2, 6, ?
I have tried everything and can't come up with the equation. Please help! Also, if you have any tips on how to solve that would be great. Thanks!

look for patterns

Since you have only 3 cases, that gives very little to go by, but

0 = 0x1
2 = 1x2
3 = 2x3

from the given I would guess at
f(x) = x(x+1) or x^2 + x