Some good advise given there.
I'd just add, your choices are quite wide and varied here, it really comes down to how much you want to spend and how adept you are at all things mechanical.
Cheapest option is the one mentioned, if sealed bearings, pull them, find the serial and order some replacements, or get your LBS to do for you.
Moving on from there, you could find a suitable coaster hub and relace the wheel yourself, or again get the LBS to do so. If trying yourself there's a great thread here to help you out if you've not done it yourself before. Quite therapeutic really, just don't rush it. First time out will take you a couple of hours or more to get right, and in reality, if you go wrong you just unlace it and go again. The satisfaction is worth it if you're up for trying.
http://www.gsportbmx.co.uk/custom/wheel_build/wheels.htmlOnly other think to be mindful of is spoke lengths. If the replacement hub is quite different in size to the current hub you may need to get some of a different length (probably not, but needs mentioning). Again, good link here for working that out, but you'd need to know the dimensions of the replacement hub before you could work that out:
https://bikeschool.com/resources/spoke-calculatorFinal option is to try and find a ready build replacement wheel, but that could prove expensive.
There is more that could be said but for that a little more input would help. Sorry if I'm being dumb, but is this an OG OS Flyer, or a newer repo type version? Are you really after a coaster (for pedal back braking & coasting) or just a free coaster type hub etc.
HTH's a little.