Sadly, you can’t earn minecoins for the marketplace. You have to pay for minecoins. I’m not sure how to do it on a pc or mobile device because I only play on the Xbox one, but I’m sure the screens for the market are similar. To buy them, there is a button near the top right of the screen. Hope that helped.