They did - or at least they tried.
This is all told in the Tale of Years (Return of the King Appendix B), the Galadriel and Celeborn material in Unfinished Tales, and Of the Rings of Power and the Third Age in the Silmarillion. I refer you to those works for the complete story, but in summary:
- The Elves originally held all of the Rings (i.e the 3 and the 16),
- Sauron forged the One and at that point the Elves became aware of him,
- There is a war between the Elves and Sauron in which the Elves lose,
- Eregion is overrun and Sauron captures Celebrimbor,
- Sauron tortures Celebrimbor and gets the locations of the 16 (in two batches of 7 and 9 each) out of him,
- And having won the war, Sauron then proceeds to corrupt Men and Dwarves in order to bring them further under his power.
The only respite from Sauron's domination came towards the end of the Second Age when Ar-Pharazon came to Middle-earth and took Sauron to Númenor.
Otherwise: the Elves tried but Sauron won the war.
Thus the Black Years began, which the Elves call the Days of Flight. In that time many of
the Elves of Middle-earth fled to Lindon and thence over the seas never to return; and many were destroyed by Sauron and his servants. But in Lindon Gil-galad still maintained his power, and Sauron dared not as yet to pass the Mountains of Ered Luin nor to assail the Havens; and Gil-galad was aided by the Númenóreans. Elsewhere Sauron reigned, and those who would be free took refuge in the fastnesses of wood and mountain, and ever fear pursued them. In the east and south well nigh all Men were under his dominion, and they grew strong in those days and built many towns and walls of stone, and they were numerous and fierce in war and armed with iron. To them Sauron was both king and god; and they feared him exceedingly, for he surrounded his abode with fire.
(Of the Rings of Power and the Third Age)