How to make a gui

So im making a weapons datapack and instead of having one massive mcstacker command for every chest/weapon i add i would like there to be a command that you can run for example /function give and it opens a gui (only visible to you no tampering) with all the weapons i have a minor understanding that you can make a barrier look like guis but idk how to implement the command/chest part of it

Continue to help post