Before we get into things today - a disclaimer. I am not a lawyer and you should not rely on this information instead of contacting an attorney. Nothing here is intended to constitute legal advice. If you're trying to figure out how to actually go through probate or develop a will, you should see a lawyer. The information provided here is for entertainment purposes and to be able to improve the plausibility of those writing about the law.
Very recently, I had the opportunity to edit a short work that hinged heavily upon the the successful exercising of a will of a deceased individual. I'm not going to name who did it, but the piece misunderstood some key aspects of law despite relying upon their use in a plausible manner to move the story forward. This happens often in the work of writers, and it is not in itself a deal-breaker to say that a work is bad. Many writers, however, try to write with their stories anchored in the real world, and there is real value in doing so.
This is one of the ones that I have seen people get wrong the most. While, in theory, it is possible to just write a will and have it enforced, the legal system has been able to deal with this in a number of ways. Most individuals who write a will do so with at least a single witness to verify that this was made by a sober and sane individual. In practice, this is almost always a lawyer or notary.
In addition, said wills are often stored somewhere quite secure - either a safety deposit box or, more often, in the hands of a lawyer. The plot of someone tampering with or fabricating a will is not an easy task. The legal system regularly sorts through multiple wills to try to determine the will which is most likely to be the wishes of the dying individual.
That being said, determining the proper will is not the end of the story. There's more to it than that. In many jurisdictions, there is a legal construction that is called a donatio mortis causa (DMC), which is essentially a deathbed gift. If this can be proven, underneath a complex legal test, sometimes a deathbed gift can trump that will they spent a lot of time on. Its a very complex legal situation.
The next big step that a lot of people don't include is the Will going into probate. This is the actual process of the will being given to the court and the legal system determining whether a will is real. The net result of the process is the court determining which will is binding, and granting the executor of the will, usually a family member or lawyer, the approval to execute it.
The executor is responsible for actually putting the will into effect. If the will has any judgement calls that need to be made, this is the person to do so. They are allowed to pay for any and all expenses from the monies available in the estate, but aren't really able to make themselves rich from it. They are often under a lot of stress as any time they exercise any judgement, they technically leave themselves open to a potential motion for someone who disagrees with their judgement call. In a case like this, the complainant can drag the executor to court to try to ask a judge whether the judgement call that was made was justified. Times when it might not be justified are giving a close friend a rate above what is generally accepted to sell the house, for example.
There is no actual obligation in the legal sense for anyone to serve as an executor. If they don't wish to be the executor, they need to make the declaration known at probate court.
This is the net assets that have been left behind by the deceased. This includes any properties (like houses), property (like paintings or collectibles), money, or legal relations (some contracts will exist after death, IP might be moving around, and more). Collectively, all of this is called the estate. The estate is then liquidated in line with what has been written out in the will. A professionally drafted will done by a lawyer will often take care of most provisions quite well, but lawyers aren't infallible.
If there is no will, or the will is silent on specific issues, then wherever the will is being executed (Canada, the United States, France, whatever) have their own guidelines for what is, in effect, a "default will". Usually, these laws dictate whatever is left goes to the spouse and/or children of the deceased.
A will, however, cannot be carte blanche to make bizarre requirements upon people in order to receive money from the deceased. If the request is somehow against the public interest, the court has the capacity to strike down different requirements of the will. A will, for example, cannot require someone to kill a third party in order to receive their proportion of the estate. That being said, cheeky things have found their way into wills before and courts have enforced them. One example I have heard of is a will bequeathing "just enough rope for her to hang herself" to an aunt the deceased wasn't a fan of. Because there was nothing in it requiring her to do anything illegal, the court was willing to enforce the bequeathing of a length of rope.
Writing about the law can be a particularly tricky task. There is a reason that many successful legal thriller writers have backgrounds that include practicing law or otherwise being involved in the legal community. In my own experience, I've found that the amount of realism you need the law to have in your story is approximately equal to how important it is to the story. If everything hinges on a legal case, then an attention to detail is going to reward you and make your readers happy.