Opening a cabin door at cruising altitude would cause the cabin to depressurise and anyone near the door and not belted in could be sucked out. Oxygen masks would drop from the ceiling and the pilot would rapidly descend, however this nightmare scenario is almost impossible.
The doors on most commercial aircraft are larger than their openings. They must first be opened inwards before they rotate and swing outwards, or upwards.
At cruising altitude, pressure inside the cabin is much greater than that outside. That cabin pressure is pushing hard against the door, keeping it locked in place. Opening the door would require overcoming that pressure which is impossible even for the strongest human.
Even at low altitudes, when the difference between pressure outside and inside is less, the doors are secured by electrical or mechanical latches.
Despite the potential for disaster, barely a week goes by without a delusional passenger trying to open an aircraft door. In 2017 a passenger was only dissuaded from opening the door on a Delta Air Lines flight when a flight attendant smashed a wine bottle over his head.
See also: Can an aircraft land in zero visibility?