Just like attributes, tabs and sections are also controllers of the forms in Dynamics 365. You can apply same logic to show and hide those controls by using Javascript.
For the tabs; you need to know unique name of the tab you are going to show/hide.
For the sections, you need to know unique name and tab name which that section belongs to.
How to find tab and section names:
From the Form editor you can find section and tab names easily. Just select the Tab and Section components in your classic or modern Form editor.

Code
One thought on “Dynamics 365 – How to Show/Hide Sections and Form tabs”