Short version: a can of diet cola has essentially no carbohydrate and no sugar, so it will not knock you out of ketosis, and plenty of people drink it happily on keto. Whether it is a good idea for you personally is a slightly longer conversation, because the worries about diet soda are less about carbs and more about sweeteners, cravings and habit. Here is what actually holds up and what does not, so you can make your own call rather than follow either the “totally fine” or the “poison” camp.
There is a stage of keto almost nobody plans for, and it is the one where the results are won or lost: coming off it. Plenty of people lose weight successfully and then pile it back on within weeks of returning to normal eating, conclude that keto does not work, and miss that the problem was the exit, not the diet. Done thoughtlessly, coming off keto produces a demoralising bounce. Done well, you keep most of what you gained.