Arrays of optically trapped nanoparticles have emerged as a platform for the study of complex nonequilibrium phenomena. Analogous to atomic many-body systems, one of the crucial ingredients is the ability to precisely control the interactions between particles. However, the optical interactions studied thus far only provide conservative optical binding forces of limited tunability. In this work, we exploit the phase coherence between the optical fields that drive the light-induced dipole-dipole interaction to couple two nanoparticles. In addition, we effectively switch off the optical interaction and observe electrostatic coupling between charged particles. Our results provide a route to developing fully programmable many-body systems of interacting nanoparticles with tunable nonreciprocal interactions, which are instrumental for exploring entanglement and topological phases in arrays of levitated nanoparticles.