Make the sidebar menu sticky

I need help to make my site’s sidebar menu sticky on scroll. So, the sidebar remains as long as it’s height and then sticky to the top.