>>997362Probably need a bottom bracket overhaul. If you have sealed cartridge bearings, this means remove them, cleaning out the bb and outside of the bearings, greasing them, re-installing to proper torque value.
If you have loose ball or retainer bearings, then it means also replacing the bearings. If you have cartridge bearings you can probably get by with keeping the bearings, just cleaning/greasing the outside.
You could also try removing the pedals and greasing the spindles, that's usually not the cause but it occasionally is.
>>997451Try taking the wheel off the bike, take the inner thru axle out, and grab the outer axle or nuts on each side of the hub and try to wiggle it. If there's play, you need a hub adjust (tighten the cones/locknuts), see Sheldon Brown or Park Tool for tutorial or go to a LBS for a hub adjust (hub adjust is one of the trickier bike maintenance things, btw, it has to be just right)
>>997465Sometimes they'll just come loose over time, especially if the locknut wasn't tightened securely enough against the cone last time it was worked on
Btw, if it's *really* loose then water could have gotten inside and done some damage in which case you may want a hub overhaul instead of just a hub adjust (open it up, clean it out, replace bearings and put in fresh grease)