You add more and more electrons as you go down into the periodic table:
First, you fill the 1s
2, 2s
2, 2p
6, ... After, you pass by the first and second row transition metals which has d-orbital electrons... Then, you come to the lanthanide group which have f-orbitals... Finally, you arrive to Ta and Pt (a long trek
). But remember, the s, p, d and f electrons you had when you filled up the orbitals are still there, as core electrons. Pt and Ta are located after the lanthanide elements, so you can expect them to have some of their electrons located into f-orbitals.
Similarly, transition metals have p-orbitals, even though they are not located in the right hand side of the periodic table. It is the same reason.
Now, for the 5d and 6s order, we write the d orbital first because its n number is lower, so its energy is lower. 5d is lower in energy than 6s. However, the 6s orbital gets filled by electrons before the 5d because the 6s in bigger in volume than 5d. More orbital volume means lower electronic repulsion between the two electrons that occupy the 6s. Both electrons have -1 electric charge, so they repel each other and it costs energy to keep them together into one orbital. With more orbital space, the pairing energy is lowered.