Part 1: "Nani" and "Nan" sometimes have different meanings
"Nani" is often used for "what kind of, which".
Q.What prefectureDo you live in (A. I live in Kanagawa prefecture)
Q. With foodWhatDo you like (A. I like hamburgers)
"Nan" is often used in "how many" (= how many).How many times, how many books, how many, how manyWhen the answer is a number, use "nan".
Q. Last year, I got a bookHow many books (Nansatsu)Did you read it? (A. I read about 10 books)
Q. There are more productsHow many (Nanko), Are you left? (A. 2 are left)
And even with the same Chinese characters, the meaning of the question changes between "Nani" and "Nan".
Q.What colorDo you like (A. I like red)
Q.What colorDo you use it? (A. Use 3 colors)
Q. IWhatIs it a class? (Mr. A. 〇〇 is in B class)
Q. This schoolwhat)Do you have a class? (A. There are 7 classes)
Q. This yearHow many years (what)Is it? (A. 2022 is the year of the tiger)
Q. Reiwa this yearHow many yearsIs it? (A. 2022 is the 4th year of Reiwa)
When speaking, think about the meaning and try using "Nani" and "Nan".