Jack got into an accident that booted him out from his own universe, leaving him stranded in an entirely different universe. Danny came along with him, but is pretty much weakened by whatever situation they were in before where he wanted to keep his dad alive.
Jack searched around for what he had on him, a few ecto-batteries, a Fenton thermos and his jumpsuit.
Luckily around him laid the very destroyed yet salvageable parts of a machine that was brought along when this happened. So he took it apart and decided to make something outta it.
Danny meanwhile is not doing that hot, so he took to sleeping his fatigue away, he doesn't know how long it'll take but eh. So when his father built a coffin he very happily climbed in and started napping away.
Which, it wasn't supposed to be a coffin nor for him to sleep in, but Jack just went what the hell and decided to modify his original plan. Installing the ecto-batteries he tinkered them to draw in the ambient ectoplasm from their surroundings (which is far less than Amity Park but eh) and release it into the coffin to act as some kind of recharge station for his kidd-o. At least he hopes, then added some straps so he could put it and voila.
There strapped to his back was the Fenton-coffin, bound to (hopefully) recharge your ghost kid from either sickness, loss of power or both! Call now and you can get on for-
Now with Danny safely secured to his back and in a safe (enough) environment. Jack went on to (hopefully) find something to get them back home.
It is weird seeing superheroes that aren't ghosts though.