Ahhh codebooks! Yes, here's a great article I have my qualitative research students read each year - find it attached! I've also attached an example of one too.
It sounds that you have already collected data for your analysis. Because you can also create a codebook prior to collecting data.
In my previous research, I created a codebook derived from the interview data which are borne out of interview questions. After listing several codes, there are two ways that particular interview data (phrases, sentences, paragraphs) could be categorized into certain codes: 1) the data are direct responses to particular questions that you formulated to draw out answers either supporting or elaborating or opposing your arguments/claims; 2) the data mention such code although they are not directly from the questions that you expected would draw such answers. This kind of data performs a facilitative role in demonstrating relationships between codes.
You may want to consider creating codes out of the concepts or variables in your research question(s) and theoretical framework.