Create UI entries dynamically:

GameObject slot =
    Instantiate(
        slotPrefab,
        container
    );

Get text:

TMP_Text text =
    slot.GetComponentInChildren<TMP_Text>();

text.text = "Sword";

Clear children:

foreach (Transform child in container)
{
    Destroy(child.gameObject);
}