You buy them. That's the mechanism, and there's no legitimate shortcut around it.
Starcoins are the premium currency, sold in bundles through the game's shop. Larger bundles work out cheaper per coin, so if you're spending anyway, buy the biggest one you'll actually use.
Be sceptical of "free starcoin generators." They're consistently phishing attempts, and the ones that aren't still want your login. Earning coins slowly through the game's activities is tedious but costs nothing.