How to create sticky TOC without plugins

Hello! I have the theme GeneratePress (free version) installed on my Wordpress site. I would like to add a sticky table of content like this one without adding extra plugins:

Is there any way to do it through CSS or with HTML through the GeneratePress block editor?

Thank you!

You should be able to do it with custom CSS. I don’t see why not.