Even in English, "Mr Tanaka library to go" is not a sentence, it's just some random words. We need to add some grammar to make a proper sentence.
は and に are particles that are attached to the ends of words to indicate their grammatical role in the phrase.
は is the topic particle, and marks the topic in the sentence (who or what you're talking about). In this case, the topic is Mr. Tanaka.
に in one of its meanings, indicates the direction of a movement, like the English preposition "to" (but it goes after the noun).
としょかん = (the) library
としょかん に = to (the) library
So: たなかさん は としょかん に いきます = Mr Tanaka goes / is going to the library.