Ranking up a dragon increases the number of stars they have, allowing you to further level them up and increase their stats. The maximum number of stars a dragon can have is 6 stars.
How do you rank up a dragon? Let’s use Wonder as an example. Wonder is a Heroic dragon.
*Caveat: Some people will advise you to use gutter Heroics to rank up your Heroics at the beginning. This is because mastery is a very long way off for beginners, and they will soon start to clutter your box.
I agree with this for the most part, but save your Dark and Light Heroics, as they have a significantly lower drop rate than other elements, and it will be difficult for you to get them back when you finally need them.
Also, never use your natural 5-star Legendaries for rank up. They are difficult to get, and you will regret it!
You may wish to consult Cat's guide in order to determine what dragons you will probably not need and are safe to use as rank-up material.
In general, you can decide this yourself by looking at a dragon's skills and determining whether or not they are useful, make the dragon strong enough to be used, and whether or not you are likely to use the dragon yourself.
The short answer is whatever dragons you use.
For your first 6-star, it is highly recommended to prioritise a damage-dealer. If you have a Water or Dark Wonder, he should absolutely be your first choice. These are dragons that you will use into late game, so they are a very good investment. Other attacker dragons that you foresee using for a long time such as Mini and Solar are also good choices.
Damage-dealers will almost always want to be ranked up to 6-stars. Attackers need to be able to hit as hard as possible, and the damage difference between a 5-star dragon and a 6-star dragon can be considerable.
Next, you may wish to work on a healer. If you chose Earth Smart as your starter, it would be a very good idea to 6-star him, both in order to complete your quest, and because he is another dragon you will likely continue to use for a long time.
It would also be beneficial to 6-star a mana battery somewhere along the line. Cupid dragons are the best mana battery. They are natural 5-star dragons, and they do need to be ranked up to 6 stars in order to evolve to an Adult. If you use a Lambgon instead, they are usually fine as a 5-star dragon, but if you find they are more useful to you than a Cupid, you may end up wanting to 6-star your Lambgon.
Naturally, your goal will be to make your main team reach 6-stars. However, you should consider that some dragons do not need to reach 6-stars if you only wish to use them in certain content. In Colosseum, for instance, you will want the strongest possible team to give you the best advantage. If you have a different team for grinding materials, then it may not be necessary to rank them all up to 6-stars.
This is very much on a case-by-case basis. For the most part, support dragons that you use only to farm dungeons will probably not need to be ranked up to 6-stars. This is because they only need to be bulky enough to last throughout a short period of time.
Once you have brought a dragon up to 6 stars and increased its level to 60, you can Master it.