Reinstall a Shimano nexus 7 wheel after puncture?
The yellow dots should be lined up when in a specific gear, which is gear 4 for a 7 speed nexus, (gear 6 for an 11 speed alfine)
Generally speaking, to change tube on an IGH wheel you need to get the wheel off the bike.

Release rim brakes to make room for tyre to pass through
Undo wheel nuts with 15mm spanner - your bike won't have a quick release.
Unclip the control cable from the rotary part, and pull the chromed cap off the retainer.

Then the wheel should come free (actual method depends if you have a tensioner, or if the bike had dropouts or trackends, etc)   and you can do the tube swap or patch the hole.
To reinstall the wheel, its roughly the reverse.   You should not need to adjust the cable in any way - the clamped on stop on the inner cable won't have moved.
If you've somehow undone the &quot;cassette joint&quot; and parts are coming off the side of the hub, then something has gone quite wrong.  Please post a clear well-lit photo of the right side of your hub, and perhaps the right side of your bike too.