If the door leaf and frame are generally in good condition, the first step is to identify the actual cause of the problem. It may be something as simple as a worn seal, a faulty lock, sagging or worn hinges, or a malfunctioning door closer. In these cases, repairing or adjusting the door is usually both easier and more cost-effective than replacing the entire door.
At some point, however, repeated repairs may no longer make financial sense. Replacing the door is worth considering if the door leaf or frame is severely damaged, the structure has become deformed, or the door is no longer suitable for its current application.