<button>Next</button>
<section>Section 1</section>
<section>Section 2</section>
<section>Section 3</section>
<section>Section 4</section>
<section>Section 5</section>
<section>Section 6</section>
<section>Section 7</section>
button {
  position: fixed;
  bottom: 50px;
  right: 50px;
  width: 50px;
  height: 50px;
  color: white;
  background-color: red;
  border-radius: 50%;
}

section {
  height: 500px;
  margin-bottom: 50px;
  color: white;
  background-color: black;
}
const button = document.querySelector('button');
const sections = document.querySelectorAll('section');
let currentSection = 0;

button.addEventListener('click', () => {
  console.log(currentSection);
  if (currentSection < sections.length) {
    sections[currentSection].scrollIntoView({
      behavior: "smooth",
      block: "start"
    });
    currentSection++
  } else {
    sections[0].scrollIntoView({
      behavior: "smooth",
      block: "start"
    });
    currentSection = 1;
  }
})

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.