What gauge wire to use for direct burial for a garage that is 400 feet from your house?

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.