In general, you don't need to prepare for office hours at all. Feel free to stop by to talk or to bring whatever questions you have.
If you'll be coming to me for help on debugging code for a class you're taking with me, I'll likely ask you what you've already tried. So in this case, at least be ready to tell me what you've already tried to do to help understand the bug that you're facing.