Best way to protect the battery and avoid heating while using dex?

Hi, as the tittle says, im wondering which will the best way to avoid heating and protect the battery while using dex connected to a power supply. Exist some bypass charging like in game booster?