One of the biggest disadvantages in the game has happened to you- the unthinkable, you've lost your leader. Whether it was from a failed attack or defense, you're now left without important boosts. You're more vulnerable to losing troops and traps.
Fortunately, there are some things you can try to hopefully get your leader back.
1. If they are in store and you can afford it, buy some death caps. Buying them for possible future use is also a smart move.
2. Check for a ransom to pay off.
3. Revenge! Set a high level bounty and hope someone claims it, message any strong guildmates or allies (or advertise on kingdom chat). Make sure the bounty matches the might of the person holding your leader as prisoner.
4. Diplomacy! Message or have your guild diplomat message the captor.
5. Friends with the overlord? Feeling bold? Message the Overlord of your kingdom for a prisoner pardon.
Aside from these steps, you will be stuck without a leader until they are executed or escape.
You will need to focus on rebuilding but also the steps you can take to avoid losing troops and your leader.
Shelter, reinforce/garrison your guildmates with long shields on, set a ghost rally on a guildless player or a darknest, run a shield and set timers to keep track.