Why is it good practice to check if a set element is present before attempting to remove it?

To avoid getting an error in case the set doesn't contain the elementTo know if we need to add a new element

To avoid getting an error in case the set doesn't contain the element.