Running scripts in bash

So I've written my first bash script.I wanted to run it from the command line, but I got an error:

$ myscript.sh
myscript.sh: command not found

So instead I try this and it works:

$  ./myscript.sh

Is this how I will always need to execute it? How can I run myscript.sh without having to precede it with ./?

Welcome to the forum. And thanks for using codes tags correctly from the beginning.

bash looks for executables in the directories listed in the PATH shell variable, to which the working directoy . usually is not (and should not be) added for security reasons. One workaround would be to add a certain path, e.g. ~/bin , and collect all your scripts there. But you would need to keep tight control of the scripts and versions in there to avoid adding (and executing) malicious code to / from there.

Thank you so much!