If one pilot is rendered incapacitated, this is not a problem. The remaining pilot declares an emergency (trust me, it is an emergency – flying a modern passenger jet in today’s airspace is not a one person job,) and lands at the nearest suitable airport.
Now if all the pilots (there are sometimes more than two) are incapacitated, that’s a really big problem. The cabin crew are going to canvass the passengers for airline pilots on that type, airline pilots, commercial pilots and general aviation pilots in that order. The lucky person(s) are going to have to attempt to land the plane. More importantly at first, they can use the radio to contact ATC to advise of the serious nature onboard.
ATC’s primary responsibility will be to create a bubble of airspace around the plane and keep it clear. Depending on the capabilities of the pilot, they will offer vectors and advice to get the plane on the ground.
If another type rated pilot is on board, then things should go fairly smoothly. If it’s a general aviation pilot, then luck will play a much larger factor. It’s like taking a private car driver and putting them in a fully loaded semi at the top of the Donner Pass and telling them to descend the pass without crashing. Not as easy as one might think.