Life evolved in the sea (so we think) and moved much later to land. For 160 million years, there were fish, but no vertebrates on land.
Lungfish were a narrow bridge from the water to the land. A bottleneck from the vast diversity of fish to the equally vast diversity of amphibians, reptiles, mammals and birds. Lungfish moved to the land about 370 million years ago, but remarkably, there are still a few lungfish hanging around. They live in Australia, South America and Africa.
Lungfish are fully equipped with gills, and breathe in the water like any self-respecting fish. In addition, they are equipped for dry spells. Maybe the pond where they lives dries up during the summer, and they burrow into the mud to tough it out. Their fins look a bit like legs, so they can waddle around on land. They have air sacs—primitive lungs—that let them breathe air during this time. Remarkably, when they are in air-breathing mode, their gills don’t work. You can drown a lungfish if you immerse it in water without sufficient time to re-acclimate!