Telling someone you are attracted to them and asking them out is not sexual harassment. It might be against workplace rules, but that depends on the workplace. Having consensual sex with someone after a date is also not sexual harassment. It could be seen as "quid pro quo" if one of them is the other's boss.
If at any point the person asks you to stop and you continue, then that is sexual harassment.
OP didn't say they were unattracted to them either. And if you saw my advice as anything other than a joke, that's on you.