When I became single a while back, I took stock of the prospects at work.
It didn't take long for me to realize I didn't want to date anyone I worked with.
It's not a big secret how you can avoid sexual harassment charges though.
Step 1) Make sure this person has actually spoken to you before and you haven't been stalking them for years
Step 2) Make sure they are not your subordinate and that you don't have any power over their employment so they don't feel obligated to accept
Step 3) Ask like a normal human being. Don't be a freakin creep.
Step 4) If they say no, then drop it. Again, don't be a creep and "harass" them about it
If you don't go out of your way to make them uncomfortable, they shouldn't have any grounds to claim harassment. Yes it's a slippery slope, so you shouldn't ask out every female you work with. Get to know them well enough that you are friends and if they say no, both of you can be comfortable working together.