Yes, your code is good.
And that my_custom_script
is a unique identifier for the script you’re enqueueing. You can find the default script handlers/identifiers here — e.g. jquery
for the jQuery library that ships with WordPress.
There you can also find more details about the wp_enqueue_script()
function, e.g. where should you use the function, the parameters, etc.