It is sad that many do not make it to more than a few months in aquarium.
The aquarium should be kept clean with periodic water changes.
Goldfish are social fish. They should be kept in groups of at least three. The tank should be of sufficient size to accommodate their growth.
A tank with a minimum size of 50 litres is recommended.