In these games, coins are usually found by defeating enemies and are given by the enemy after battle. These will disappear shortly however. In Paper Mario: The Thousand Year Door, completing troubles and helping people will grant you Coins. Badges and Items can also be sold to obtain Coins.
Here, coins are still often found by defeating enemies but in a manner of fighting them in non-RPG style. Some enemies such as Zombie Shroom and Ghoul Shroom will dispel many coins. Pigarithm and Hogarithm do the same. Coins can also be found in coin boxes or in the field too. You can also find hidden coin stashes underground or in other areas. Generally, if you switch into 3D, you can obtain more coins than you could in 2D.
While in Super Paper Mario, coin blocks containing multiple coins will have a glowing coin symbol imprinted upon them that is only visible while in 3-D.