Simple menu>submenu creation

I started using Arduino just like a month ago and before that I have no programming background.
I want to create this menu(2options) with a submenu for each one;I have really tried for like 3 days with MenuBackend and other libraries but since I’m not that experienced in programming I think the easiest way to do it is with “switch and button states” but I just can’t figure it out.

This might be pretty simple but the understanding of it would be priceless for me.

The circuit consists on 4 push buttons (Up, Down, Select, Back), I’m using an Arduino Mega.
I appreciate any help, thanks in advance.

Images of the basic schematic attached below

MainMenu:
[Screen1]
>Icecream
Cake 
[Screen2]
Icecream
>Cake 
////////////////////////////
MainMenu:
[Screen1]
>Icecream
Cake 
if(Enter Icecream){
  >Chocolate
  Vainilla
if(Enter){
    print("Enjoy")}
  ////////////
  >Vainilla
  Strawberry
   if(Enter){
    print("Enjoy")}
  //////////////
  >Strawberry
  Blueberry
   if(Enter){
    print("Enjoy")}
  ///////////
  >Blueberry
  Back
    if(Enter){
    print("Enjoy")}
 ////////
  >Back (Go to MainMenu screen)
}
//-------------------
MainMenu:
[Screen2]
Icecream
>Cake 

if(EnterCake){
  >Chocolate
  Flan
   if(Enter){
    print("Enjoy")}
  ////////////
  Chocolate
  >Flan
if(Enter){
    print("Enjoy")}
  ////////////////
  Flan
  >Back
  (Go to MainMenu screen)
}