My editor instantly freezes when I add a Blueprint class

When I try to add a blueprint class, instead of showing Parent classes to use, my editor instantly freezes. When I open task manager, it says that Unreal Engine is not responding. It’s similar to this question (Why editor freezes when i add blueprint class? - Blueprint - Epic Developer Community Forums) but it didn’t get resolved, so I had to post one on my own for help.