Study the information about prefer and would rather.
1. You can use prefer to and prefer -ing to say what you prefer in general.

I don’t like countries. I prefer to live in cities/I prefer living in cities.

Remember the structures!

I prefer something to something else.

I prefer doing something to doing something else.

I prefer to do something rather than (do) something else.
I prefer to drive a car than travel by train.
2. Would prefer (I’d prefer)

This phrase can be used when you say what somebody wants in a specific situation.

Would you prefer espresso or cappuccino?
3. Would rather = would prefer

We should use would rather + infinitive (without to)

I’d rather stay at home today.
4. The structure: I’d rather you did something.

In this case we use the past, but the meaning is present.

I’d rather you made lunch.

I’d rather make lunch.

I’d rather you didn’t do something = I’d prefer you not to do it.

I’d rather you didn’t tell anyone about these details.