"you had better get some sleep" means "you ought to get some sleep" (because you are tired).
"You would rather get some sleep" means that you would prefer getting some sleep to staying awake (given the choice).
They're completely different idioms. Could you explain why you confuse them?
Ok now I got the idea. It´s just that I normally see "I´d rather" and not "You´d rather", so it sounded kind of weird to me to affirm that someone prefers something. But with your explanation I understood the difference.
What I also find hard to understand is how the choice can be made for someone else by another person. The only way I can understand it is that the speaker thinks that it would be a good choice for someone else. But it is not that the speaker makes the choice.
I think (it's my opinion), that you would rather get some sleep (than watch TV).