Hey Pearl,
That code would go at the end of your functions.php file of your child theme. If you do not have a child theme, catch themes has a guide on how to create child themes (I do not know the specific url but you can google it). There are a few plugins that could aslo help to make a child theme if the process seems to hard.
And the last resort (if everything about a child theme seems to0 complicated and you are scared of messing things up) is to add the code to the themes functions.php file BUT just before you do a theme update, go to the functions.php file copy the code, do the update and then open the file again and paste the code afresh since every time you do a theme update the functions.php file will be wiped of any code that you added.