Here’s a slippery little beastie; neither official canon nor a fandom semi-consensus of fanon. Headcanon is a writer’s own personal explanation for events, character tics, and various bits of worldbuilding that canon either leaves gaps in or doesn’t explain to a writing fan’s satisfaction. So you make up something that seems plausible for the world and isn’t contradicted by canon, and go from there.
For example, take the character of Ikoma, grumpy but heroic steamsmith in the anime Kabaneri of the Iron Fortress. In the series, he wears a pair of glasses with the left lens clear, and the right lens green. With no explanation given. That’s not unusual in anime; fashionable asymmetry is a Thing, and it also shows up in samurai Kurusu’s outfit. Given the two end up fighting back to back, it could just be a style choice on the part of the artists.
But what’s the fun in that for a writer? It’s much more interesting if there are reasons for this odd little detail.
To create a good bit of headcanon, first make sure you know everything canon says about the detail in question. It saves you from embarrassing reviews later along the lines of, “but episode 7 clearly states that’s because of X!” Note, if this happens and you still like your explanation better, keep it. Just make an author’s note for your readers about this detail being AU. Or avid fans will be justifiably cranky.
Getting back to the case where a detail isn’t explained, so you create an explanation to make your writing easier. Such as Ikoma’s glasses. Here are the facts I assembled.
First, except for episode 12 (which is all kinds of action and Drama), Ikoma wears them most of the time. Times he doesn’t tend to be at night, indoors, or both. Second, in the few bits we see when he’s a child, he doesn’t wear them. Third, as far as I can tell from lens-glare effects, both sides do have lenses. It’s not a case of one lens being broken out, from the way light is portrayed glinting the left lens is there, just clear.
Put together, all of this implies that sometime after Ikoma’s home station fell, he developed light sensitivity in one eye. Several things might cause this, but two of the most obvious are some kind of eye disease… or a concussion messing with the nerves.
There are a lot of things that go boom in the Kabaneri ‘verse. Including – especially – suicide charges. One of which we know a young Ikoma used on his sister’s body.
Resulting headcanon: A much younger and slighter Ikoma used the charge and miscalculated, ending up thrown off balance enough to hit his head, causing an injury that affected his vision and led to the glasses.
Note, none of this affects canon details as seen in-series. It’s just a useful extra hook to hang stories on, especially if you’re trying to delve into the backstory of a character whose canon background is skimpy on details. Coming up with a few extra details to add that don’t change the basic story is a bit like extending the deck in the back of the house; if you’re careful, you can build new fics on top of it.
Which is what headcanon is for: making the original story make sense in your head, so you can write better, more interesting fics.