I was struggling hard to hide the Activities and Closed Activities from the form’s left navigation pane. Then came across the post which explained how to achieve the same. Actually in System Entity’s Form we can remove those links using Form Editor, however we cannot do the same for the custom entity’s form. There we can make use of Xrm.Page.ui.navigation class to hide them.
Check out the helpful post