How can I prevent getting shingles?

Vaccine & be healthy. The shingles vaccine, zostavax, is available to adults in a particular age group. Zostavax helps prevent shingles, but is not completely protective. Some people can still get shingles even though they were vaccinated. Zostavax costs about $250 if not covered by insurance. Shingles can occur if one's body is stressed or immunosuppressed, so staying in optimum health may prevent a shingles outbreak.
You can't. Vaccination will diminish the possibility of the infection but will not eliminate the risk completely.