Simplest form - general preference
The simplest form is like this (e.g.)
"I would rather drink tea than coffee"
Note the similarity to would prefer, but since rather is an adverb and prefer a verb, prefer "I would prefer to drink tea than coffee". Students may get these confused and say things like, e.g. *"I would rather to drink tea than coffee."
With a relative clause
"I would rather you made me a cup of tea than a cup of coffee."
Here the use of would backshifts the rest of the sentence into the past tense, but the meaning retains present/future irrealis. Note this doesn't happen with prefer to "I would prefer you to make me a cup of tea rather than coffee".
In past time
"I would rather have drunk a cup of tea than coffee"
Needs perfect. Compare "I would have preferred to have (had) a cup of tea rather than coffee".