“Which preposition should I use after the verb ‘prefer’?” is a common question among non-native and native speakers alike. Long story short, if you want to express that you like something more than something else, you can always use prefer to:
He prefers coffee to tea.
They prefer swimming to running.
The use of “prefer over” in place of “prefer to” (as in “I prefer apples over oranges”) is a relatively recent phenomenon (the expression only started gaining a little bit of ground in American literature in the 1940s and was almost non-existent in British literature until around 1980). Nonetheless, it is still about 10x less common than “prefer to”, and many native speakers consider it unnatural, so use it only at your own risk.
It is worth mentioning, however, that “over” has become quite popular in connection with “prefer” in the passive voice. For instance, I was able to find both variants used by the same author within the same (law) book:
In general, “preferred to” is still about twice as common as “preferred over” in English literature, so the former is the safer choice, but using “A is preferred over B” is much more acceptable than using “people prefer A over B”.
There is one case, however, when using “prefer to” is not possible. When comparing two verbs, instead of “prefer to verb to to verb”, one should use “rather than” (or rephrase the whole sentence):