I prefer something to something else.
I prefer doing something to doing something else.
I prefer to do something rather than (do) something else.
こんな感じで上のふたつは形をあわせ、下だけはto doとrather thanという使い方になります。
I prefer basketball to football.
I prefer driving to traveling by train.
I prefer to be very busy rather than have nothing to do.
would rather (do)=would prefer (to do)
I’d rather get a taxi than walk home.
I’d prefer to go for a swim rather than play tennis.
I’d rather eat at home than go to a restaurant.
I’d prefer to think about it for a while rather than decide now.