A few simple rules to follow.
1) 1 gallon of tank water per 1 inch of adult fish (this rule only works for medium to small sized fish, up to 3 or 4 inch in adult length). Goldfish are massive waste producers so they need 20 gallons for the first fish, 10 gallons for each fish after.
2) Tropical fish need a heater.
3) All fish need a filter rated 5-10x turnover per hour, so a 30 gallon tank needs 150-300 gallon per hour rated filter.
4) The cycling process builds up bacteria who consume fish waste. Doing a fishless cycle in your tank is the best way to ensure they are healthy. A fishless cycle is NOT letting your tank run without fish for one week, two weeks, two months, or even one year... a cycle is not something you LET your tank do, you need to MAKE your tank cycle by adding ammonia or adding fish. Ammonia is safer so that your tank is already cycled BEFORE you add fish. Please google information on "fishless cycling" and do some research.
5) Do regular water changes, once every one to two weeks change out 10-40% of the water in the tank.
6) Always use dechlorinator on the water before adding it to the tank.
7) Don't overfeed! When in doubt, feed less. Overfeeding can easily kill a fish but most fish can go anywhere from weeks to months without being fed and quickly bounce back once fed again.