There is a method called scrollTo(x-coordinate, y-coordinate), which allows you to scroll to a particular set of used coordinates. By making use of this one-liner code you will be able to scroll anywhere that you have bind on your web page.
const x = 100; // or any values const y = 50; // or any values const scrollToTop = () => window.scrollTo(x, y);
In addition to that, you can also set to have a smooth scrolling animation by adding the "smooth" behavior option.
const scrollToTop = () => window.scrollTo({ top: 100, behavior: 'smooth' });