Surprisingly regular grocery store marshmallows can be used as bait for fish. Why does it work as bait despite being completely unnatural for the fish? It is likely thanks to the gelatin ingredient, derived from collagen, taken from animal body parts. Carp in particular are fruit eaters, so the sugar content alone might entice a bite in their case. In any case, there doesn't seem to be any great research into fish eating marshmallows, so it is still not fully understood.
While it is likely possible to catch a wide variety of fish with marshmallows, its effectiveness is largely associated with a few types of fish. Those being: trout, sunfish, catfish, and carp. You can use mini marshmallows, full-size marshmallows, or cut pieces to your desired size. Marshmallows will be buoyant until they dissolve and break down too far.
Fishing bait companies also make marshmallow-based products. In these cases, they typically add additional coloring and scents. These companies include Magic Products and Atlas Mike's.
It is also a common claim in fishing folklore that marshmallows are effective because they look like feeding pellets. Thus stocked fish who have been raised on pellets in a hatchery will readily eat the marshmallow when they are released into your local waterbody. While this might contribute to fish behavior at some level, fish who have lived their entire lives in the wild will also eat a marshmallow.