What does it mean that you have 6V & 3A at input?

Do you have 6V source and you measured that your charger takes 3A from it?

If yes than your charger takes 6x3=18W from power source and outputs 4.2x0.5=2.1W dissipating in charger 18W-2.1W=15.9W. Its efficiency is 2.1/18 = 12%.

But I suppose that you simply don't know the input current of your charger so you can't calculate power dissipated in it.

Assuming that 3A is not measured current but 6V source limit current and that your charger takes 0A for its own purposes and it is linear you get that as your charger outputs 0.5A than it also takes 0.5A.

With such assumptions input power is 6x0.5=3W and output is like previously 2.1W so lost in charger power is 3-2.1=0.9W.

But to get true result you need to know input current.