1
HTML/CSSBeginner#css#flexbox
Use CSS Grid or Flexbox for the two-column layout, then set position: sticky with top: 0 on the sidebar so it stays in view while the main content scrolls past it, as long as the parent isn't shorter than the sidebar.
.layout { display: grid; grid-template-columns: 250px 1fr; }
.sidebar { position: sticky; top: 20px; align-self: start; height: fit-content; }