  Ferrimagnetic nodal-line semiconductor Mn$_3$Si$_2$Te$_6$ keeps the records
of colossal magnetoresistance (CMR) and angular magnetoresistance (AMR). Here
we report tuning the electronic transport properties via doping and pressure in
(Mn$_{1-x}$Mg$_x$)$_3$Si$_2$Te$_6$. As the substitution of nonmagnetic
Mg$^{2+}$ for magnetic Mn$^{2+}$, ferrimagnetic transition temperature $T_C$
gradually decreases, while the resistivity increases significantly. At the same
time, the CMR and AMR are both enhanced for the low-doping compositions (e.g.,
$x = 0.1$ and 0.2), which can be attributed to doping-induced broadening of the
band gap and a larger variation range of the resistivity when undergoing a
metal-insulator transition by applying a magnetic field along the $c$ axis. On
the contrary, $T_C$ rises with increasing pressure due to the enhancement of
the magnetic exchange interactions until a structural transition occurs at
$\sim$13 GPa. Meanwhile, the activation gap is lowered under pressure and the
magnetoresistance is decreased dramatically above 6 GPa where the gap is
closed. At 20 and 26 GPa, evidences for a superconducting transition at $\sim$5
K are observed. The results reveal that doping and pressure are effective
methods to tune the activation gap, and correspondingly, the CMR and AMR in
nodal-line semiconductors, providing an approach to investigate the
magnetoresistance materials for novel spintronic devices.
