This question already has an answer here:
I read this story a few years ago (estimate: 8-10 years), so I was around 13-15 at that time. The language of the book was German, but I'm not sure whether or not that is the original language of the book. If I remember correctly, the story consisted of three books in total.
The story starts in some town where a boy either gets thrown out of the house or leaves voluntary. He then wanders around, talks to some neighbor until he comes to some sort of intersection / street with some trees (may have been palms). There a strange phenomenon catches his eye: between two of the trees the world looks somewhat strange, like there is a window cut out of it. Curious, the boy goes through the window and finds himself in another world. There he is being attacked by (ghosts?) and flees into a tall tower, where he finds a knife with a blade so thin you can't see it with the naked eye. It has two sides, which are different from each other. With the knife he somehow escapes / defeats some of the "ghosts" and travels on.
Later in the story, he learns by cutting with his knife he creates those ghosts or kills someone somewhere by doing so. Knowing that, he tries to use it only as much as needed.
Some time later he then opens a window to the world of death where he has something to accomplish (probably rescuing someone).