=IF(X1=1,"do one thing if X is 1","do the other thing if X isn't 1")
The function, as you rightly said, is IF, and if you type the word IF into
Excel help it will tell you the syntax and how the function works.
Your problem description "it is not working" can scarcely be described as
the most specific diagnostic information that we have ever seen, so if you
don't want to test our clairvoyant powers you may need to give us more
information, such a what formula you tried, what error message (if any) you
got, what data values you were feeding into the formula, what results you
got, and what results you expected to get.