@primal quarry An item is one of the many ways to open it! And you're absolutely correct: Items are the most common way. You can do this by putting this into your main file.
import { world } from '@minecraft/server'
world.events.beforeItemUse.subscribe((data) => {
if (data.item.typeId === 'minecraft:netherite_sword") {
actionForm(data.source)
}
}
Since we already made the code for the menus earlier, we don't need to do it again. If the item that the player uses is, let's say a netherite sword, the menu will pop up. Again, we already made the menu as a function, so we can define it anywhere with ease, such as in the fifth line.