My usual poker spot tends to have a lot of ne'er-do-wells, it's next door to some pretty crime-ridden towns, and the walk between the building and the parking lot is practically an open invitation for a bold robber.
In the way of defense, I am extra-vigilant when walking between my car and the building, and I keep my windows rolled up and doors locked as I'm leaving (often late at night). I bring less cash with me than I might bring to a safer spot, I keep my poker funds separate from my wallet (which has much less cash in it), and when I must handle my cash, I do so discreetly.
In the way of prevention, I stay stone-cold sober, and I wear my "New York face" (what some might call a "don't **** with me" face) while I'm up and about. I also avoid walking into any isolated areas when any questionable-looking folks are nearby. It probably also helps that I'm 6 feet tall and wear all black.
In a broad stroke: Don't look or act like a mark, don't advertise your money, don't put yourself in weird spots, keep your eyes open, and be prepared to respond quickly if necessary.