Get a large enough tank. The minimal tank size for one goldfish is 15 US gallons (Remember, they grow to about 10-12 inches, and sometimes over!) and you will need to add 10 U.S. gallons onto that for each additional goldfish. Please read about all different kinds of goldfish, common goldfish, comet goldfish, and other single tail goldfish need ponds or HUGE tanks, don't get single tails, unless you have a 180 US gallon tank laying around.
Though for decades goldfish have been depicted in small bowls, that's why they're synonymous with short life spans (ammonia builds up quickly in such a small space). In order to increase your goldfish's length (and quality) of life, give it a decent-sized aquarium.[1]