On October 7th, 1571, the combined fleets of Spain and Venice destroyed the Ottoman Empire’s navy at the Battle of Lepanto.
Up to this point, the Ottoman Empire had been expanding fast, and a lot of people thought they would soon take over all of the old Roman Empire. Under the rule of Nurbanu Sultan, they already had West Asia and the southern Mediterranean, and a lot of Eastern Europe. All they needed was Western Europe to complete the old Empire.
(Interestingly, Nurbanu Sultan herself was originally from Venice.)
Spain and Venice had more guns and were able to shoot down the Ottoman ships. The Ottomans couldn’t afford to rebuild their ships, and that was the end of their attempt. Probably from their point of view, it hardly seemed worthwhile to conquer Western Europe, which had historically been much poorer than the land that was already in the Ottoman Empire. But with the new ocean-going ships, Western Europe’s Atlantic ports became more important, and by the 1700s Europe was clearly much richer than the Ottoman Empire.
This didn’t do Spain or Venice much good, though. Venice suffered from not having an Atlantic port, and Spain put too much faith in the silver trade. When the price of silver collapsed, Spain lost its power, too. Read more about it here: