The man comes in late, spends an hour or two texting on his cell phone, falls asleep at his desk and shows near-zero productivity. This has been going on too long. It’s time to fire the guy. Even worse, he’s your brother-in-law.

But what steps must you take to do fire him correctly? How do you avoid violating labor regulations, and how do you head off possible lawsuits?

It may be comforting to the distressed employer – who in many small businesses has the additional pressure of dealing with an incompetent or ineffective relative – to know that every state except Montana allows employers to adopt an “at-will” employment policy. That is, the employer is able to terminate any employee anytime, for any reason or for no reason. Theoretically.

“Your power to fire is not unlimited,” notes a U.S. Small Business Administration circular on legal firing.

There can be a contract or oral agreement that somehow limits the employer’s right to fire. And there are special circumstances that block certain dismissals. If it’s a family member you want to fire, there are complicated sensitivities to take into account, possibly leading to damaging intra-family disputes.

Employee contracts generally spell out the possible reasons for firing someone, specifying grounds for termination as “poor performance, dereliction of duty, an act of dishonesty or insubordination, or because the company needs to eliminate the employee’s position,” according to Business Management Daily.

“If an employee is under contract … the terms of the contract apply,” according to the business-advice publication. In other words, it spells out grounds for discharge but it can also protect an employee who doesn’t fit any of those categories.

Other instances in which dismissals are illegal, even in an “at-will” workplace, include when an employee is dismissed:

  • Because of their age, gender, religion or disability.
  • Because they’re a whistleblower who has reported illegal activity by the employer.
  • Because they’re exercising their legal right take family or medical leave, time off to vote or serve on a jury.

If you want to fire someone in Montana, you have to abide by that state’s

Wrongful Discharge from-Employment Act, which allows “at will employment” only during an employee’s six-month probationary period. In other cases, dismissals are “wrongful” if they are retaliation for refusal to violate a public policy (or to serve as a whistleblower for such violations); if they’re not for “good cause”; or if they violated the employer’s own personnel policy.

Other states add their own wrinkles. In heavily-regulated California, for example, an “oral contract” can restrict employers in certain circumstances. Says human resources consulting company Human Resources 4U in its blog: “An oral contract may have been created if the employee was told her job was secure, or that she would always have a job if she did a good job, or some other similar guarantee of employment.”

In some cases, there may be “implied contracts” as well, such as with long-term employees who can produce evidence of being in good standing in their jobs. These could include, says Human Resources 4U, “promotions, commendations, lack of criticism of the employee’s performance or other indicators of job security.”

So you’ve done your research and you have ample documentation of the employee’s poor performance, such as records of tardiness, reviews recording his failure to work effectively, and previous disciplinary interventions. You’re sure you’ve got legal grounds to fire your delinquent employee. How should you proceed?

Keep it simple, says Business Management Daily. “Follow basic rules of legal and business etiquette to allow the employee to leave with dignity — and not return with a lawsuit.”

Explain in objective terms the reason for the dismissal, and allow the employee to have their say. “Avoid using any harsh words during termination meetings that would serve only to inflame the issue,” says BMD. “Stick to the facts; don’t make generalizing statements.”

If the employee is a family member, be sure all of the business’s principals are on board with the decision to fire. “It’s crucial for the family to document why the person is being terminated so the family is clear that it’s a business decision, not one based solely on emotions,” says Veronica Dagher, who writes about financial issues for the Wall Street Journal.

Have the discharged employee’s final paycheck ready and explain his or her right to continued benefits. These may include temporary continuation of health insurance, particularly if the workplace has 20 or more employees, and unemployment insurance. If the job provided a 401(k) profit sharing program or pension benefits, the dismissed employee remains eligible.