We usually prefer to use which when choosing between a limited number of options (like two or three, or options from inside a category) and what when there is no limit to the number of options:
Which do you like better - ketchup or mustard?
(only two options)
Which philosophy books do you recommend?
(options from inside the category of "philosophy books")
What do you think about politics?
(there are infinite possible answers)
What's wrong with the TV?
(there are infinite possible answers)
However, in spoken English, we often use "what" even when "which" would technically be better:
I have black tea and green tea. What kind do you want?
The only time we MUST use "which" is when saying which of or which one(s):
Which of the students are going to fail the course?
Bob and Jerry, which one of you is going to help me fix the window?
All these cakes look delicious. I don't know which one to buy!
I'm considering several different cars; I'm doing research to find out which ones are most reliable.