First off, it is great if you design your own base. It helps if we have many different types of base design, as long as they are somewhat sane. If you find it hard, just copy the design of someone with the same town hall and approximately similar progress (walls, splash towers), and optionally modify it.
In war you may see an opponent base of your level that looks particularly fearsome and daunting. If that is the case, look at it as a prospective new design for your own war base. Perhaps this will enable you to spot weaknesses. If the design keeps inspiring awe, consider copying it into one of your war base slots and trying it out in the next war.
The list below is ordered by importance.
Put your Town hall in the core of your village. If the Town Hall survives, the opponent can get a single star only. All defences should be used towards the aim of protecting the town hall.
Town hall 8 is an exception to this. It is probably best to centralise your clan castle rather than your town hall. The reasoning is that that this makes it harder to lure the clan castle troops. The big challenge at town hall 8 is to prevent an (easy) three-star attack by another town hall 8. It is ideal if a base survives multiple three-star attempts, or requires an enemy town hall 9 to step in. For this it does not matter whether the town hall survives; making your clan castle troops harder to lure will cause the opponent to use more troops for the lure and hence weaken their chances of a three-star attack.
Put air defences and sweepers behind at least two layers of walls (if you have enough walls to do that). Put them on different sides of the town hall, close to the town hall, and (for TH 7 and higher) protect them with storages (see below).
Do not take special measures to protect storages (such as placing them centrally). In a clan war you will not lose loot if they are destroyed. In fact you can use storages to protect your defences, especially your air defence, as storages have very high hit points.
If you can (TH 7 and higher), consider putting your clan castle in a central place so the troops in it are hard to lure. This can be hard to do given that the Town Hall needs to be centrally positioned as well, so it is merely a recommendation.
These are more important than cannons and archer towers. Make sure they are not too close to the outer perimeter of the walled part of your village. Try to make the base such that the obvious paths for enemy troops after blasting through the outer walls lead to cannons, archer towers and traps and bombs rather than your splash defences.
Put all or the majority of your traps and bombs on the inside of the base. Avoid by all means a perfectly blocky base where everything lines up without traps or bombs. Such a base is everything that giant/healers and hogs dream of.
Preferably do not put your bombs but especially your giant bombs in an obvious space where the attacker can place troops (such as just in front of walls). A good attacker will spread out a few barbarians and trigger the bombs without suffering many losses.
By putting teslas and giant bombs on the inside, you will have open spaces. Optionally you can add a few more open spaces, creating more uncertainty for the opponent.
Make sure that a good number of giant bombs and spring traps are on the shortest path between two defences, and that this path is impossible or very hard to avoid. This is to combat hog attacks.
At th9 and th8, consider a double giant bomb layout, where two defences sandwich a pair of giant bombs. It is paramount however that it is very hard for an attacker to either avoid their troops (hogs) taking this path or to trigger one or two of the bombs using just a few scout troops.
These should be outside the walled sections so that enemy troops will be slowed down and draw fire. Ideally these structures will be in range of your defences, as many as possible.
Note that we do not mind a 1-star loss for 50% (or more) destroyed. As long as the town hall stands, the opponent will score at most a single star, even if the other 98% of your village is destroyed.
If you know what you are doing, you can conceivably use these structures as a meat-shield and then this advice does not apply. This is probably only doable in high town halls (at least 8 or 9) where you have many walls.
The last thing you want to do is to fill in a walled segment with collectors only.
Make sure your base has more than just a few walled segments in it.
One approach to base design is to make little funnels in your base, where invading troops are led across traps or bombs, making giant healers attacks likely to fail. See for example the base of Badger Bane, it follows these designs:
For TH 7 and higher, consider one disadvantage of putting buildings far away in a corner (such as builders huts): these can be used to lure clan castle troops far away from the base where they can be taken out more easily. It is good to be aware of this when deciding on your layout.
It is not a good idea to have two layers of walls glued together. Wall breakers do splash damage and will destroy the second layer as well. Glued walls are ineffective in nearly all circumstances and give you less walled space.
Spiking the outside of your base with single walls (so that the enemy cannot place troops) looks interesting. It will hamper the opponent in placing and directing troops, but other than that it probably just means fewer walls to protect your defenses.