Coins are the most common of items that first appeared in Super Mario Bros. In the Mario Bros. series, if the player collect 100 coins he will get a 1-up. They also serve as a currency in various games, such as in the Mario party series. Coins appeared again in Super Mario Bros. 3 where they had a different design and they looked similar to american doller and the Canadian doller However this was later changed in the remakes.
In the game if you go in a door you can collect a Mushroom and a few coins at the end of each level.
You collect them as normal. After you get 100 you get a 1-Up Mushroom.
In User Wiki
In User Wiki, coins can be gained and lost in the store.