To add the directly above it.
Don’t do that.
First of all, don’t edit those files in the WordPress Editor at all if you can avoid it. It’s quite possible that you could make an accident in a PHP file, save it, and get completely locked out of your site (yep, I’ve done it in years past). If you’re ready to edit code, you should get yourself a real live code editor and learn how to update such things properly.
If adding your code there doesn’t work—meaning the code literally doesn’t end up loading on the front-end of your website—you may have an issue with your theme. Quickly switch to a default WordPress theme (Twenty Fourteen, Twenty Thirteen, etc.). If it works on that theme, your theme is poorly coded. Make plans to fix that with a higher quality theme, or go ask that developer you hired why they didn’t follow WordPress’s best practices. Lacking the
wp_footer() (and, potentially, other) “actions” means that plugins will work unpredictably with your site, and you’re missing out on the value of the WordPress ecosystem.
If you feel the need to add a code snippet somewhere instead of using that dead simple plugin above, please properly create your own plugin, and enqueue your scripts.
Why the fuss?
This is one of those places where you need to trust folks who have been where you are. If you want your snippet of code to carry over when you change themes, there’s no reason to hardcode things into your theme files—that’s what plugins are for.
Save yourself the trouble of having to fix it later or not knowing why things aren’t working right. Use a good plugin (or correctly build your own), and let that vet that theme you’re using.