P mosfet as high side switch heating
According to the FDD4141 datasheet, the threshold voltage of this P-channel FET can be as small as 1V. Your square wave is nominally 3.3V and your power is nominally 4.2V, so you just squeak by at 0.9V. There is not much margin for error there.
If for some reason your voltages are a little off, the FET may not be shutting off completely.
Similarly, according to the datasheet, the threshold voltage may be as large as 3V. When the gate is at 0V (relative to ground) the gate-source voltage will be enough for the FET to start conducting, but it may not be enough to get the resistance very low. That is, the FET would not be fully &quot;on&quot; in this condition.
Either of these scenarios will cause the FET to heat.
It is off-topic on this site to ask for product recommendations, so I won't give you one. However, you either need to rethink the voltages in your design (maybe you can't -- a Li battery and a 3.3V uC?) Or choose an FET that will be strongly ON at a -4V \$V_{gs}\$ and definitely off at -1V \$V_{gs}\$