The easiest way is to use a spirit level to determine whether the door or frame is out of square. If the door is the culprit, hold the spirit level against the door and line the bubble to the center. Draw a line along the door’s width to mark how much material to remove.
You can then plane the door so it sits level.