One way to remember the difference is to associate "nani desu ka" with a more formal or polite tone, as the word "desu" is often used to convey politeness in Japanese. On the other hand, "nani sore" can be remembered as a more casual or familiar way of asking about something.