the which command you're using assumes the argument "my_command" is inside your PATH. which searches via your global environment variable PATH for the argument that you type and lists the complete path to the first match it finds.
You can find your path by typing env on the command line and looking for PATH=.
whereis - searches for files in a restricted set of locations, such as standard binary file directories, library directories, and man page directories. This utility is a quick way to find program executables and related files like documentation or configuration files.(This does not search user directories or many other locations that are easily searched by find or locate)
and of course if you know the general location you can use the find or locate command.