Help getting switch working properly
With the hot being supplied at the ceiling fixture when you tied the hots and neutrals together you wired the light hot all the time. If the switch wiring was included when tying things together when you turn the switch on it should trip the breaker. To correct this the best practice is to wire the white going to the switch to the hot and Mark this white wire black or another color other than green, or gray. Next the black coming from the switch to the black on the light and the white on the light to the bundle of whites (not the white black already connected). This way the remarked white is easy to identify as an old style switch leg. If you pulled the old 12-2 or 14-2 with ground out you should pull a new 12 or 14 3 with ground as modern code requires a neutral at the switch location for smart switches. Then the always hot to the switch would be tied to the black hot from the panel to the switch and the red wire connected to the other side of the switch would be to the black of the light. Grounds connected together and whites connected together in the ceiling box. If not using a smart switch just cap it until it may be needed later.normaly Normaly red is used as the switched conductor by profesionals. This should get your light working and the other devices powered from this location. I just reviewed the photos again and you already have an x-3 with ground going to the switch but the wire is short, adding a junction box in the ceiling would allow some connections to be made then a short piece of wire to the old junction box to make these connections , I would check at the switch box to see if there is enough wire slack to make the switch connections if not an old work box can be added and another short section of wire added to make it to the switch. In a garage it would add 1 box that will be exposed and need a solid cover and 1 box in the ceiling that will need a cover but this way be cheaper and less work than pulling new conductors unless the walls are still open.