You would do it the same way as any other PHP application, this isn't a WordPress problem.
To remove an item from an array in PHP, use unset( thing to remove )
.
E.g.
$test = [ 'banana', 'cucumber', 'apple' ];
unset( $test[1] );
// cucumber is no longer in the test array, and the array now has 2 not 3 items