My LEGO character's helmet keeps falling off... Is there any way to fix?
The best and most effective technique I've come across is to use a bit of nail varnish on the inner anti-stud of the helmet piece, as Tonk explained on his blog TonksToysBlog. Just be sure to apply a very tiny amount and give it plenty of time to dry.

Also, if it matters to you, the helmet you have pictured does not go to the figure pictured. The figure is Jay Legacy from 2019. The helmet, on the other hand, is 98133pb02 from 2012-2016.