GL Codes are assigned automatically. A GL Code (general ledger code) is the accounting category that tells your books which expense account a purchase belongs to, so your spend is recorded correctly without extra work.
If you need to change the default, you can assign GL Codes manually at the product level within your cart. You can also split a single product across multiple GL Codes or departments – for example, charging part of an order to one department and the rest to another.