In the original stories written by Sir Arthur Conan Doyle, Sherlock Holmes and Professor Moriarty directly confront each other only once. Their fateful encounter occurs in "The Adventure of the Final Problem," which was published in 1893 as part of "The Memoirs of Sherlock Holmes" collection.
In "The Final Problem," Sherlock Holmes realizes the extent of Professor Moriarty's criminal network and the threat it poses to society. To protect innocent lives and dismantle the criminal organization, Holmes decides to confront Moriarty directly. The two adversaries have a deadly showdown at the Reichenbach Falls in Switzerland, resulting in both of them apparently falling to their deaths.
Conan Doyle intended "The Final Problem" to be the end of the Sherlock Holmes stories, and he wanted to move on to other types of writing. However, due to the public's strong demand for more Holmes stories, the author eventually brought the detective back in "The Adventure of the Empty House," where it is revealed that Holmes had survived the encounter with Moriarty.
While Holmes and Moriarty's direct confrontation only occurs once in the original stories, Moriarty's influence and legacy continue to be felt in the Sherlock Holmes canon and in various adaptations and spin-off works that explore the character's criminal empire and the impact of his rivalry with Holmes.