Each transaction has a tag field, which can contain up to 27 arbitrary trytes. If you are looking for a way to group or categorise transactions, this is probably the field you are looking for.
IRI nodes also support a findTransactions command, which you can use to query for transactions that match (amongst other things) a specific tag.
Each transaction has two fields, trunk transaction hash and branch transaction hash, which refer to 2 other transactions (contain the hash of the entirety of these two transaction). When building transactions, you can set both of them, or you can set one of them (to promote it), or you can set none (both are determined by tip selection).
How exactly you set ...