The verb "need" can function as a linking verb or an action verb. As a linking verb, you can say "need + do" just like you say "can + do" but when it functions as an action verb, an infinite will have to follow "need". That is when you say "need to do something