@Taha the tocbot script itself and the instructions/process I used are free and available here:
You might want to hire someone to do it for you, if reading the instructions on that page is not enough. Also, if you don’t know how to make changes using CSS, you can hire someone to do that too. (On mobile, the “abnormal behavior” you describe can be easily corrected in the CSS. That is just one of my personal test sites.)
As you can see on the tocbot demo page, by default, it already looks and behaves a lot like the TOC you see on GitBook.
It is a very fun and useful skill, and after you do it once, it can become addicting to keep adding features and tweaking the look and feel of your site - I encourage it!
There are sooooo many free tutorials, forums and other learning resources on the internet if you search them out.
Also, as with anything, you can hire a human to teach and tutor you through your learning process!