Welcome to this tutorial covering how to make a robust inventory system. In any game which uses items, you'll usually need some way for the player to view and use their items – hence the inventory.
Different games tackle this in different ways, which means there are plenty of ways to build an inventory depending on your needs. There are also several other examples on this site, so if this doesn't do what you need, be sure to check those out.
The main inspiration for this style of inventory comes from Nintendo's The Legend of Zelda: Breath of the Wild. In this project, the inventory is split into several different categories (stored in arrays) to allow the player to store different kinds of items. When the player is highlighting a particular item, its details are displayed using information stored in a JSON file. The inventory can be sorted and allows items to be added and dropped as necessary. It is all controlled via the keyboard.