Short answer: no, these are different things, and you can't compare Git with GitHub. The same statement applies to questions like Git vs GitLab or Git vs Bitbucket. Example from another profession: coffee cannot be compared to a café because the first is the drink and the second is a place where this drink is served.
Git is a software that tracks code changes and coordinates the work of developers working on that software. Developers can safely update the source code without the risk of breaking it.
GitHub, GitLab, and Bitbucket platforms store repository data along with its history. In addition, they provide you with graphical interface to manage your repository users and their permissions. Another feature available on these platforms is the CI/CD pipeline, which is state-of-the-art in automated application testing, build, and deployment.
In other words, Git knows how to quickly encode and decode changes made to a repository, and GitHub stores the changes in a central place accessible to team members.
Without a version control system, you would have to manually merge your and other developers' work. For large projects with many people that would quickly become disorganized and counter-productive. Git takes care of tracks all your files and protects you against overwriting other developer's changes. You can focus on building the software and sleep well. Even for a solo developer, Git is an irreplaceable tool that keeps the history of changes which you can preview at will.
Git was developed by Linus Torvalds in 2005 because he needed a better version control system (VCS) to further develop the Linux kernel. He was disappointed with the other VSCs that were either not meeting his needs or were too slow. You can read how Git was created in this interview with Linus Torvalds on The Linux Foundation page.