How do I politely tell a student to take a shower?
Normally my advice would be identical to Buffy’s, to simply talk to the student. At least, I would have liked to think that we live in a world where that would be the correct, and obvious, answer to the question. However, the reality is that in today’s culture there is a great deal of sensitivity about certain topics, such that when a college instructor makes a comment to a student about those topics, the result may be unpredictable.* This is particularly true in matters relating to personal appearance and behavior, even more so when other factors like gender, race, mental health, disability status and perhaps other things get dragged into the discussion (which may end up happening whether or not you think it ought to), and even more so when the parties involved are of unknown temperament, sound like they may not be the most sensible people around, and cannot be counted on to react in a reasonable fashion even to the most benign and well-intentioned of approaches.
Considering all that, given your situation I should think that it would be a trivial matter to go to your department’s staff and/or faculty administrators such as the vice-chair or chair, and ask for suggestions how to proceed. Make it clear to them that the situation is untenable and that the student’s hygiene problem is impinging on your other students’ rights to benefit from a physically safe and healthy educational environment while attending your class, so that you feel that some action must be taken. And do not worry about being a busybody or wasting their time - this is indeed a tricky situation and it is perfectly reasonable even for a very experienced instructor to wonder how to respond and seek advice.
Finally, if your administrators suggest that you talk to the student — which is after all the obvious, and probably necessary, solution — well, then, at least you will be able to say that you followed the advice of officialdom rather than strangers on the internet, should your friendly suggestion to the student end up being ill-received.
* Many discussions right here on academia.se, among other things, have opened my eyes to this reality - one memorable one involved an instructor wondering how to respond to a female student coming to class in a bikini top, if I remember correctly. I remember being rather taken aback by the diversity of opinions on what should be done in such a scenario, as well as by the judgmental tone of some of those opinions.
Some things are just best said straight out. Oddly enough, people don't always recognize their own body odor. But calling the student aside, or to your office and just saying that it is common practice to bathe/shower daily and use some sort of deodorant will be an advantage for them in all social situations. Again, they may not recognize the problem and will, perhaps, thank you for your honesty.
Polite sometimes means being direct.
Talking to the student is the first step. I realise I'm duplicating other answers with this.
What isn't duplicating other answers is to say that when you do, make sure you have another person present. This is potentially something which the student could get highly offended over. A shouting match would be embarrassing but not ultimately too harmful. Some people might even resort to violence. More of a worry for you should be the threat of the student starting formal disciplinary proceedings against you. All these are prevented by having an independent witness.