Just add to the already created points.
Difference between
Xrm.Page.ui.tabs.get('new_fieldname').setVisible(false);
and
Xrm.Page.getAttribute('new_fieldname').controls.get(0).setVisible(false);
The first relates to the tab ( Xrm.Page.ui.tabs ), the second refers to the attribute ( Xrm.Page.getAttribute ).
So, if you want to hide the whole tab, its sections and fields, you can use the first one. If you want to just hide a separate field, you can use
Xrm.Page.getControl("new_fieldname").setVisible(false);
Which itself is a shortcut from
Xrm.Page.ui.controls.get('new_fieldname').setVisible(false);
source share