Magnetic field is one of the key agents that play a crucial role in shaping molecular clouds and regulating star formation, yet the complete information on the magnetic field is not well constrained due to the limitations in observations. We study the magnetic field in the massive infrared dark cloud G035.39-00.33 from dust continuum polarization observations at 850 $micron$ with SCUBA-2/POL-2 at JCMT. The magnetic field tends to be perpendicular to the densest part of the main filament (F$_{M}$), whereas it has a less defined relative orientation in the rest of the structure, where it tends to be parallel to some diffuse regions. A mean plane-of-the-sky magnetic field strength of $sim$50 $mu$G for F$_{M}$ is obtained using Davis-Chandrasekhar-Fermi method. Based on $^{13}$CO (1-0) line observations, we suggest a formation scenario of F$_{M}$ due to large-scale ($sim$10 pc) cloud-cloud collision. Using additional NH$_3$ line data, we estimate that F$_{M}$ will be gravitationally unstable if it is only supported by thermal pressure and turbulence. The northern part of F$_{M}$, however, can be stabilized by a modest additional support from the local magnetic field. The middle and southern parts of F$_{M}$ are likely unstable even if the magnetic field support is taken into account. We claim that the clumps in F$_{M}$ may be supported by turbulence and magnetic fields against gravitational collapse. Finally, we identified for the first time a massive ($sim$200 M$_{sun}$), collapsing starless clump candidate, c8, in G035.39-00.33. The magnetic field surrounding c8 is likely pinched, hinting at an accretion flow along the filament.