To remove a submodule, follow these steps:
.gitmodules
filegit add .gitmodules
.git/config
git rm --cached <path_to_submodule>
.git
directory:rm -rf .git/modules/path_to_submodule
git commit -m "Removed submodule xyz"
rm -rf <path_to_submodule>
The submodule's files as well as its configuration are now gone.