If you write fantasy, then the odds are you have castles in there at some point. They seem to be an inevitability; the one part of the medieval flavour no one can avoid. Yet castles are both older and more complex than that. The romans had square walled wood and turf forts, for example, while even iron age peoples probably had a certain amount of defence in mind with their hill fort enclosures. So here are some things to bear in mind:
1. What kind of castle are you writing? As far as I can tell, writers generally either write the Disney castle, or a classic concentric arrangement with successive walls. Yet there were so many other options, from motte and bailey stuff to simple keeps.
2. Is it dragon proof? Remember that castles evolved as an efficient way to keep out enemy armies. If said enemy army can fly, or reduce your wooden walls to ashes, there isn’t much point. If you create a fantasy universe where that sort of thing is common, you have to expect that people will have come up with answers.
3. Black spikes with everything. Castles were as much about show as function. That’s why you find castle-y stuff on relatively minor houses in parts of the UK. They were about a claim to status, and about extending power. So make sure yours shows off.
4. Castles need peasants. Castles were full miniature economies, needing a lot of people. More importantly, one of their functions was to extend power over an area, which needs to include people for them to serve a useful purpose. They aren’t just somewhere for knights to live.