If you install the intarray extension this is quite easy:
select id, members - (select array_agg(member) from unwanted_members)
from foo;
To update the table you can use:
update foo
set members = members - (select array_agg(member) from unwanted_members);
Without that extension, you first need to unnest the member IDs remove the unwanted and then aggregate them back to an array:
select f.id, array_agg(t.mid order by t.idx) as members
from foo f, unnest(f.members) with ordinality as t(mid,idx)
where t.mid not in (select member from unwanted_members)
group by f.id;
To update the existing values, use this:
update foo
set members = x.members
from (
select f.id, array_agg(t.mid order by t.idx) as members
from foo f, unnest(f.members) with ordinality as t(mid,idx)
where t.mid not in (select id from unwanted_members)
group by f.id
) x
where foo.id = x.id;
Assuming id
is the primary key of the table.