A good war-base that is hard to three star (TH8 and low TH9), or hard to two star (TH10 and occasionally high TH9) can have a big impact on the war outcome. If you can draw multiple attacks or force a clean-up from a higher level town hall, that'll affect the enemy's total war score.
Different approaches are required depending on what Town Hall level you are, as you'll be facing different types of attack.
If you're struggling to build a good base, there are plenty available online and we have some good ones of our own design too. Using a very common internet base is normally best avoided as many people will have seen it before and may know how to defeat it. Some internet bases are not well-designed either, so ask for opinions if planning to use one. If going with an internet base, make a minor tweaks (such as moving bombs/teslas to other useful spots) so that it is a little harder for any attackers who happen to know the base.
Watch your defences in war. They will reveal weaknesses in your base that you can fix.