i need to create a mega-menu from a list in SharePoint online. as similar to the once below to my SharePoint. I have never used or tried to add GITHUB code sample to my SharePoint. Please let me know how to use the code samples from GITHUB like the one below. https://github.com/SharePoint/sp-dev-fx-extensions/tree/master/samples/react-mega-menu
Just to be clear, the sample you are pointing to is using the SharePoint Term Store. And not a list as source.
You also need to use SPFx dev tools to complete that sample. Please have a look at this page for more information regarding SPFx development. https://docs.microsoft.com
You can download the repository as a zip using the method described in the image below:
One other way is to use GIT which is a way of version control your code. I like to use the SourceTree application for easy management of git repositories. SourceTree