An if statement chooses commands based on an exit status. The bracket command can test whether a path is a regular file or a directory. A nonempty path string alone doesn't establish that the file exists. Quote path parameters inside the test.
Include the alternate branch so the script has defined behavior for missing input. These tasks use a present regular file and ask you to keep the reusable existence check in the saved script. Spaces around the bracket syntax matter because [ is a command and ] is its closing argument. Write [ -f "$1" ] with each part separated. A directory can exist and still fail -f; use -d when a directory is required. Test both branches with appropriate paths before trusting a script that reports success.