If it's your own capability then you can just instantinate it directly. Use the getDefaultInstance to grab a default instance for a modded capability that you need. In general if you can instantinate it - you probably should.
I would also recommend reading about capabilities on the official docs, they might answer some of your questions. Feel free to ask if you don't understand something.
You don't need to get an instance of the capability like this for the IItemHandler since forge provides one for free at CapabilityItemHandler.ITEM_HANDLER_CAPABILITY. You can though, obtaining capability references using CapabilityInject is the way to do this.
Don't do this for inventories. This method is acceptable for capabilities provided by other mods if you just need the default instance but an inventory capability holds a certain amount of slots, which you declare in it's constructor. Just instantinate ItemStackHandler.
This is a forum, not a chat room, please be patient.
In your getSubItems you must check that the tab you are adding the item to is the tab it is supposed to belong to. Otherwise it gets added to every single creative tab, including the delete slot.
when i is 0, it removes 0. [(0),1,2,3,4]
when i is 1, it removes 2. [1,(2),3,4]
when i is 2, it removes 4. [1,3,(4)]
when i is 3, the loop terminates. [1,3].size() < 3