Would rather
Would rather- Subject + Would rather + Verb
Talk about specific preference
Would rather is used to show preference with the comparison.
It’s such nice weather, I would rather go out on walk than watch TV.
Would prefer
Would prefer- Subject + Would prefer + To + Verb
When you talk about general preference then use just prefer.
I would prefer cycling to walk.
I would prefer jazz to rock music.