The verb need = I need, you need, he/she/it needs, we need, they need.
Neither of your examples is the infinitive of "need". Both are incomplete. Thety are used as follows:
I need to go to bed
He needs to stay at home
- For Teachers