you should use skript-gui, here is an example of how you can use it:
function gui(p: player):
create a gui with virtual chest named "&cGui" with 3 rows:
make gui slot (integers between 0 and 26) to gray stained glass pane named ""
make gui slot 4 to shiny emerald named "&aTest":
send "&aThis will be sent to the player upon clicking the emerald" to {_p}
open last gui to {_p}