Scripts in your search path should have unique names(different from other system commands including shell builtins) i.e. avoid names such as firefox, vlc, nano, echo, cd, test, sudo ... etc
.
Scripts in your search path are run by filename(including extensions like e.g. .sh
if used) without specifying the shell interpreter(these are executables that take their arguments as script files with full path or script command strings but not an executable/scriptfile in your path that you call by just its filename) before it but rather include a shebang in it i.e. not like this:
sh scriptname
But rather like this:
scriptname
Scripts in your search path need to include a shebang(The first line in the script that tells what interpreter should be used to run the script) that looks like this:
#!/bin/bash
or this:
#!/bin/sh
or even this:
#!/bin/python3
and so on.
Scripts in your search path need to be made executable first like so:
chmod +x /full/path/to/scriptname
That's how they work.