Napoleon did go to war with the Ottoman Empire. In May 1798 the government of revolutionary France dispatched him with an expeditionary force to conquer Egypt, an Ottoman vassal, in the hopes of threatening Britain's access to India. In July he decisively defeated Egypt's rulers the Mamelukes at the Battle of the Pyramids and then set about establishing a puppet government. In February he carried the war into the Ottoman territory of Syria, conquering the city of Jaffa and summarily executing 3000 Turkish prisoners. However he was defeated by a combined Ottoman-British defense at Acre and forced to retreat back to Egypt, which had grown weary of his rule. With his fleet having already been destroyed by the Royal Navy at the Battle of the Nile in August of the previous year, Napoleon fled back to France in October 1799 and left his subordinates to handle the collapsing situation in the Middle East. Although the Egyptian campaign had ended in disaster it had greatly increased Napoleon's fame and was what convinced Emmanuel Sieyès to invite him to help overthrow the revolutionary government in the Coup of 18 Brumaire.
You might also like to read my answer to the question Why did the revolutionary French Republic even consider, much less actually launch, the seaborne invasion of Egypt in 1798, given the Royal Navy's dominance of the seas around Europe at the time? As the failure of Napoleon's expedition suggests, it did not really serve France's strategic interests to get involved with the Ottoman Empire, and in fact much of Napoleon's meddling in the east had more to do with personal and symbolic goals rather than political ones.
Source
Bell, David. Napoleon: A Concise Biography. Oxford: Oxford University Press, 2015.