Then I got some error it said failed to execute something and then I wasn’t able to open up applications and after a force restart I wasn’t able to boot into EndeavourOS. I did manage to recover some stuff via timeshift with live ISO but I wanted to know why would uninstalling these packages ruin my system even though I just installed it?
The -c option can be dangerous if you do not pay attention to the list of packages that are proposed to be removed.
man pacman:
-c, --cascade
Remove all target packages, as well as all packages that depend on one or more target packages. This operation is recursive and must be used with care, since it can remove many potentially needed packages.
Arch wiki:
To remove a package, its dependencies and all the packages that depend on the target package:
# pacman -Rsc *package_name*
Warning: This operation is recursive, and must be used with care since it can remove many potentially needed packages.
The issue is that you combined -Rc with -Rs. -Rs is recursive downward and will even will include optional dependencies. When you combine that with -Rc which is recursive in the opposite direction that can create a mess.
Of course, the real issue here is not which options to pacman you chose to use. It is that whenever you perform any package operation, you need to carefully review the list of changes to ensure that is what you want to happen.