It's only needed if you're developing an add-on and you want to include a third party dependency. Even then it's not strictly required, but as a developer tool it makes a lot of sense to use it.I never worked with composer before. Do we need to install it? And could you provide some example code how to work with it?
Support with composer is really beyond the scope of this thread and support in general. I would recommend starting with any official documention first: https://getcomposer.org/doc/01-basic-usage.md
Then if you have any specific questions about it, probably post a new thread in the XenForo development discussions forum.