How was the first Japanese-English dictionary made? In other words, how could the author map correctly each Japanese word to its corresponding one in English?
To the best of my knowledge, and the knowledge of the dictionary's creator, the first Japanese-English dictionary is the one published by by James Curtis Hepburn in 1867. Hepburn was a physician and Protestant missionary in Japan, and you may recognize his name from Hepburn Romanization.
In the preface to the dictionary, Hepburn notes that he is responsible for most of the contents. That is, he learned the language and then compiled what he had learned into a dictionary. To quote Hepburn himself:
[The words] here published have been collected, for the most part, in the course of [the author's] own reading, or heard in use among the people
Hepburn also cites the Portuguese-Japanese dictionaries published by the Jesuits in 1603 and a "small vocabulary" by a contemporary Dr. Medhurst (from what I can tell, Walter Henry Medhurst, known for his work on Chinese-English Dictionaries), but ultimately claims responsibility for the bulk of the dictionary.
A scan of the dictionary, including the preface that I cite above can be found here.
Biographical information came from the wikipedia article about Hepburn