炊事 belongs to formal/institutional vocabulary — military, school cafeterias, large dining halls. You'll see it in compounds like
炊事班 (cooking squad),
炊事员 (cook),
炊事用具 (cooking equipment). For everyday home cooking use
做饭 (zuòfàn) or
烹饪 (pēngrèn) instead.