I'm going to assume you mean the LG G4, because there is no "LG4."
The G4 was plagued by a design flaw that led to a bootloop. I know that sometimes led to a repeating optimizing apps screen. So try putting the phone in the freezer for 5-10 minutes and then try to boot up. If it boots fine (it may optimize once more then then boot properly), then you are being hit with this design flaw too and the only solution is to replace the phone. Basically the phone can't handle the heat build up and it causes a solder joint to fail, which is why putting in the freezer works.
Besides, that phone is pretty old and past due for an upgrade anyway unless you plan to use it for nothing but phone calls. If you get it working, that is.