The US navy blockaded the coastline of the Confederate States of America.
This prevented imports - vital to the South because of its agrarian cotton growing economy - of manufactures,
food,weapons,and other war materiel.It also prevented the Confederacy from exporting cotton to earn foreign currency and gold to pay for large scale imports.
Although some blockade runners were able to sometimes slip through the blockade,it was on nothing like the scale necessary.The blockade essentially starved the Confederacy of vital imports needed to conduct their war effort more effectively and crippled the economy.
So,the US navy could be said to have played a vital role in winning the war for the Union.