So how do i earn those if they cost diamonds, a lot of diamonds?
What are you referring to? Spell fragments and combining catalysts don't cost diamonds. Unless you're trying to craft something and don't have enough materials, then it would offer a diamond cost. Almost anywhere in the game you see something costing diamonds, it would be because you don't have enough of the materials (other than premium buildings, extra builders, upgrades to the MA above level 2).
To get spell fragments, open your inventory and click disenchant. You'll see how much each item is worth before making any decisions. Spells, instants and unplaced buildings can all be disenchanted and some are worth more than others. For buildings, the fragments are determined by the size of the building (chapter does not matter).