Here's how it works:
* Avoir means "to have"
* Besoin means "need"
* De is the preposition that connects "besoin" to the thing you need
Example:
* I need a pen.
* J'ai besoin d'un stylo.
Note: "Avoir besoin de" is followed by a noun or pronoun that refers to the thing needed.