If you are going to use your custom js code then what you have to do is first register your custom script then enqueue it.
//now enqueue it
//desired_name(called handle) is what you have given in wp_register_script above
now add this in a action hook
Place the codes in functions.php
If you want to use this in plugin give correct path on registering the script use
plugins_url() to get the directory path then continue with yours and use it inside the plugin.
If you want to link general main jquery just use the handle name
jquery alone you don't have to register it, because WordPress provides preloaded scripts in the core you can check it Here Default Scripts Included and Registered by WordPress at the bottom. Feel free to ask doubts on this:)