The gold standard for the J400F remains LineageOS. Thanks to a dedicated community, builds exist that push the device well beyond its official limits.
Boot into TWRP (Power + Volume Up). Choose Wipe > Format Data , then Advanced Wipe (System, Data, Cache). j400f custom rom
Follow this process exactly.
Install lineage os 19.1 (Android 12 ) on Samsung Galaxy j4 plus The gold standard for the J400F remains LineageOS
Select your downloaded ROM file (GSI or ZIP) and swipe to install. then Advanced Wipe (System