There is usually an adjusting screw on most garage door chain-drive units. You can probably just back it off to get some slack, reset it on the sprockets, and tighten it back up. You will probably then need to adjust the limits.
I’d also recommend you check the sprockets for broken or worn teeth. There has to be a reason it came off in the first place.
If the sprockets are bad, you’ll need to have the opener serviced.
Call us at (513) 821-5095 for a no-hassle appointment.