Is this word кофе neutral !!... why do we say горячий not горячее ?
Most of the time by the ending. If it matches one of the existions endings in Russian it would have the gender in accordance. If it's an ending Russian words don't naturally have, like "-у", "-и", "-ю", the gender would be neuter in most cases except with the living beings (the gender of nouns like "пони", "кенгуру" is usually arbitrary either masculine or feminine). Though variations are possible, especially with more recent loan words and brand names, but that's the rule of thumb.
"Кофе" is simply an exception. It doesn't follow any logic, but using it as a masculine noun is considered "educated". However as of modern times using it as a neuter noun is not a mistake. Still some people would look down on those who do that. It's one of the more notorious points of contention in conversations about Russian language among the natives.
Because кофе used to be masculine. It used to be spelled кофей. At some point the spelling got switched to кофе, but it technically remained a masculine noun.
Кофе being masculine or neuter is actually a joke among Russians. Nowadays more and more Russians are simply treating it as neuter. However, treating it as masculine is the sign of an "educated" person.
There is a joke among Russians: If the coffee is good, it's a "he." If it's bad, it's an "it." "It" as in "❤❤❤❤" because "говно" means "❤❤❤❤" and говно is neuter.