Hey there.
Rather than building in your own go to top type button/link there are plugins that can do this. Should be quite lightweight and will save making a child theme too.
https://wordpress.org/plugins/scroll-back-to-top/screenshots/
https://wordpress.org/plugins/wp-scroll-to-top/screenshots/
https://wordpress.org/plugins/wpfront-scroll-top/screenshots/
Hope this helps :)
Take care and have a great day!