"He cannot do anything."
Translation:Han kan ikke gjøre noen ting.
"hva som helst" means more like "whatever one chooses". so it's not completely out of range, but the meaning would be too different.
What you wanted to say would translate into English as (more or less) "he cannot do whatever he wants", which is a different idea from "he cannot do anything".
"Hva som helst" is only 'anything' in the sense of "whichever one you may choose".
I'm only a beginner, but I would suppose that using "hva som helst" might express something like, the subject cannot do as he pleases in this situation. Which is different from saying there's not a thing he can do.
At minimum, you can be sure that in a sentence with no negation, they keep their plain definitions as 'something' and 'someone'. Only when there is negation occurring in the sentence do you have to worry about a shift. And then it should usually be possible to work it out by context: ignore the 'noe' or 'noen' at first and look at what the rest of the sentence is trying to say, then it should be clear what the remaining word is being used for. And eventually we come to know this better by familiar patterns than by rules.