1. adverb
Almost; nearly.
It is next to impossible to get him to admit it, but writes very well.
2. preposition
a) Beside; alongside.
Do you mind if I sit next to you?
When you start the next to the last roll, get some more paper.
Wikipedia foundation.