Stack Overflow is not a code writing service
Stack Overflow is a code writing service. Among other things, we write code for people. There are certain subjective limits to how much code we will write for people, or how much explanation we think is necessary for the asker to understand the answer they are to receive; but I regret to inform you that Stack Overflow is in fact a code writing service.
You are expected to write code yourself
Well, to a degree. You are expected to be able to write and understand code to the extent that is necessary to understand the answers you may receive, but this is really subjective and the bar is low.
How-to questions are not inherently off-topic, and only debugging questions explicitly require code
See also: What's better: a question with no attempt or with an unfixable/irrelevant attempt?