In a function, the input is "x" and the output is "y".
So, let's replace the words "output" and "input" in your sentence with "x" and "y".
It now reads:
Y is 2 less than X.
Almost there... translate is = equals, 2 less than X as x-2.
y=x-2
Put in function notation:
f(x)=x-2