The fish was caught in the ocean along with other fish in a fishermen’s net. The iron lump in the fish’s stomach was taken by the hunter Jarā, who fixed it as an arrowhead at the end of his shaft.
Srimad Bhagavata Purana
श्रीमद्भागवतमहापुराणम्
मूल श्लोकः
मत्स्यो गृहीतो मत्स्यघ्नैर्जालेनान्यैः सहार्णवे । तस्योदरगतं लोहं स शल्ये लुब्धकोऽकरोत्
matsyo gṛhīto matsyaghnairjālenānyaiḥ sahārṇave | tasyodaragataṃ lohaṃ sa śalye lubdhako'karot
SB 11.1.23