#get the chosen id from the array
$execute store result score .random_essence essence run data get storage minecraft:mechanics essence.list[$(id)]
#remove it from storage
$data remove storage minecraft:mechanics essence.list[$(id)]