Basically, git commit "records changes to the repository" while git push "updates remote refs along with associated objects". So the first one is used in connection with your local repository, while the latter one is used to interact with a remote repository.
Here is a nice picture from Oliver Steele, that explains the Git model and the commands:

Read more about git push and git pull on Pushing and pulling (the article I referred to first).
Basically, git commit "records changes to the repository" while git push "updates remote refs along with associated objects". So the first one is used in connection with your local repository, while the latter one is used to interact with a remote repository.
Here is a nice picture from Oliver Steele, that explains the Git model and the commands:

Read more about git push and git pull on Pushing and pulling (the article I referred to first).
commit: adding changes to the local repository
push: to transfer the last commit(s) to a remote server
Whats the purpose of a git commit VS git push?
using-git - incremental_games
What is this? Got it while `git push origin master` today!
Latest Commit Is Not What Gets Pushed. Very Confused, Started Git Yesterday, Can't Find Guidance That I Actually Understand : git
Videos
Just to be clear, I know what git add, commit, and push all do. When I write code and I solved some bug, what I do is
git add . git commit -m "this thing finally works' git push origin main
I never do a commit that I don't push right after. And that's because I don't get why I should commit what I don't intend to push. And if I don't intent to push, why commit? Just to be clear, I know HOW these commands work. I don't understand their WHY.