When do you use which? Is one method better than the other?
Code Snippets is typically used for adding code that does not involve adding directories and files on your server.
Whichever method you use, there is no right or wrong here.
Do note that there are some subtleties and adding the same exact code might work in one but not the other. Example.
Personally, I prefer using My Custom Functionality since I am quite comfortable working with code and edit the files using Visual Studio Code or Sublime Text.
Please log in again. The login page will open in a new tab. After logging in you can close it and return to this page.