JTAG and Android are two separate things.
You may find JTAG pins visible either under your device's battery or near its SIM / MicroSD card holder. The pins are hidden. You may have to dismantle your phone's back cover. The JTAG pins are usually six gold pins clustered close to each other, as shown in this photo:
You use a special hardware JTAG box which comes with a vast array of cables (different cables for different types of devices), plus specialized software specifically made for your device model. (There exist generic catch-all JTAG boxes that can be loaded with specific microcode instructions for your particular manufactured board. The tricky part is getting the exact microcode for your device's circuit board. If you use the wrong microcode, it can cause permanent damage.)
The microcode instructions are emitted by the JTAG box attached to the cable, clipped in position on top of the JTAG pins. The box sends a signal to your device to revive it. Now an appropriate firmware image can be flashed to your device.
This is a highly specialized topic. A background in electrical engineering can be handy, to know which pins are used for ground (GND), transmit (TX), receive (RX) and power (PWR). The power is the important one: if the battery is dead, power can still be fed into your device.
You can buy JTAG boxes online, but they tend to cost a couple hundred US dollars or so. It's because of differing manufacturers with different types of cables, and different arrangements of on-device JTAG pins.