the pedal wobbles in the arm
That sounds like a stripped pedal thread. If the cranks are inexpensive or dubious, replacing them could be cheapest.
But in some cases a good bike mechanic can repair a stripped pedal thread by installing a helicoil or similar coiled insert - basically they tap out the hole for a yet larger size, and the wire insert fills up the space between that and the threaded pedal axle. You and your mechanic would have to make your own decision if this is appropriate in the circumstances of your particular case.
Normally modern pedal threads are specific to each side of the bike (the left pedal gets a reverse or left-hand thread) such that they will self tighten from precession when riding, especially on something with a freewheel where you cannot exert real reverse torque anyway. A pedal with the wrong thread for the riding torque of the side on which it is used will indeed unscrew, but being able to create that situation with modern components would be fairly unique to an exceptional case such as riding a fixed gear artistic cycling bike more backwards than forwards, or mistakenly installing a unicycle's wheel backwards in the frame. Otherwise, for the pedal to unscrew you'd have to have a pedal bearing so damaged that the bearing drag dominates over the precession.
An alternate possibility is that the pedal's internal bearings could be loose, such that the pedal's axle is fixed to the crank but the pedal itself is wobbling on the axle. That may be correctable by tightening if the bearing balls are not yet lost or can be replaced, or you may need a new pedal.