Depends on the size of the sub-panel in that garage. If you are installing a 60 amp sub-panel 400 feet away from the main service panel then use AWG # 4.
For that distance I would run AWG # 3 copper and install a sub-panel.
AWG # 4
A 200 amp service panel with a 60 amp sub-panel.
You will need to run AWG #4.
Assuming the voltage is 240 volts, the wire size for a 100 amp panel at the end of 400 feet and holding the voltage drop to 3 %, the wire will be 3/0 in size.
AWG 2/0 copper.
Need to know what the load amperage is on the 100 amp panel. If interested, open discuss question page.
AWG #6 will work fine at 100 feet with only a 2% drop in voltage which is acceptable.
8 AWG copper is rated for 40 amps. Over 150 ft, at maximum current, the voltage drop would be about 3.76 volts. Using 6 AWG would have a voltage drop of 2.36 volts with the same 40 amps.