Fish seems to have nostrils like the ones human beings have. but they are not used for breathing at all.They are only used for smelling things and is not part of the fish respiration system. Instead, fish breath through the gills.
Human used to have gills on an early development stages in the womb, but the fetus loses that functionality in later stages. Fish is different. Fish always uses gills to breath. That is because fish live under water all through its life, so the whole metabolism is maintained by gettting enough oxygen through the gill. Then why land land animals breath with the lung in place of the gill? First of all, the gill structure will lose water quickly and if terrestrial animals do breath using gills they will lose water quickly and dry up and die. This is no big deal to fish because they live under water all the time. Secondly, the gill needs the buoyancy from water to expand. Once the gill leaves water, it will collapse into something like a meat ball and lose all the functionalities it supposed to have.
Then how does fish breath start? Well, it starts from the fish mouth. (A fish will open and close its mouth all day just because this is a process to utilize the gill to pump fresh air in continuously.) However, some small fish just can't get enough oxygen this way, so they also need to swim here and there so fresh air can move in the mouth faster. When fish (partially) closes the mouth, the operculum of the fish opens, so water can go cross the gills. Then gill rakers filters the big impurity particles of the water, then water will be allowed to go through the gill arches and pass through the gills, which is composed of complicated layers of lamellae, which are thin membranes loaded with capillary network. Water flows across the lamellae, then oxygen and waste gas are exchanged directly on the capillary membrane. After the oxygen in the water is used up, the "used" water then passes out through the operculum.