You fish. That is genuinely the whole answer — Goldenfish are small, golden fish, and they come out of the water like any other catch.
A few things improve your odds. Goldenfish are a rare bite, so the standard approach is to keep casting in the same spot until one takes the hook, and to reel in promptly, since a slow response loses the catch. Eating a fishing-related meal before the quest helps, and some players swear by particular maps and seasons.
Beyond that it is patience. They are used in specific combination recipes, so if you are gathering for one, budget several casts per fish.