Use account codes to group your income and expenses. When creating invoices or purchase invoices you assign an account code to them.
Then when you reconcile your bank statements, the corresponding income and expenses are assigned the same account code.
To create account codes, go to "Setup > Finances > Account codes".
Account codes are listed on your profit & loss page as well as your yearly budgets.