They can be moved into another public service role, and there are ceremonial roles designed to ‘shelve’ MPs, but other than that, criminal acts and incapacity, they can’t actually stand down. Starmer is resigning as Prime Minister, he is not resigning as an MP.
This is why the other parties see the whole thing as a farce. The chancellor approved the budget for the by-election by saying “if he wants to spend his summer talking to a bin, so be it” but it’s unclear if there’s any constitutional legality to it.