Buddy. I have on numerous occasions gotten this question by friends and family. My advice is, don't bother.
Now, I mean don't bother if you are trying to get something in the form of a relationship going. If it's merely to hook up, fine, go ahead.
Why I say don't bother is for many reasons. Mainly stemming from personal experience and also from just knowing people who dealt with it.
When a girl is with someone for 2 years, she has established such a connection with that individual. 2 Years of her life was devoted more or less to this guy. Think of it like this. If you start a job and you work at it for 2 years, you pretty much grow innate with certain things and aspects about that job. How long it will take you to get there, what you have to do, what time you can take a break, etc. It just becomes eventually natural. Well, in relationships, it's the same game (almost, as this is just an analogy, not science fact).
So, a majority of her mind was devoted to this guy. Regardless of how good or bad the break up was, that 2 years is engrained in her brain. Those memories, nicknames, moments, presents, etc all take time to fade away from the mind.
I dated a girl back in my Frosh year of college. She was with a guy for 4 years, broke up summer before college, and then off to college she was. We clicked, it was fun, and I began to like her (this is pre-PUA days of course). So we went on dates, hung out, hooked up, etc. But, there were always moments he would pop up. It would be random phone calls, texts, and even a surprise visit. So, I was the schmuck. Her and I did end up together, but it was so much drama it was not even worth it.
My friend, roommate in college, dated this girl who just recently broke up with her bf. They jumped right into it. Well, low and behold, she tagged him along, refused to settle and said she didn't want a title on the relationship they had, and she even hooked up with other men.
The reason I say is don't bother is because it takes some time to get over someone. Even if the relationship was such a bad one, when people break up, they hurt and feel pain because all they can do is remember the good things. Regardless if the bad outweighs the good, people tend to dwell on the good of a relationship because it justifies why they were together for so long, why they were together in the first place, and why they liked each other through all the bad. They try to make it "worth while". Logically, it isn't that at all. So, when a person breaks up, they have those memories in their mind, and though they may be with you, they may be sitting and thinking about the other. Anything can trigger a memory. Say you take her for some coffee, but she may have had a cute little memory with her ex at a coffee shop. It will automatically trigger that emotion/thought/feeling/and memory.
When I break up with a girl, my mission is to go out and just go wild. It's my way of getting over the girl. But even when I am having sex with a girl I met at a bar, or hooking up, or even taking out to eat, my mind wanders towards my ex (especially if it was a long relationship as most mine were, and especially if it was like just a few months ago). Nicknames would slip. I even slipped my ex's name with a girl I met. Why? Not necessarily because I missed her, but because like I said before, 2 years of someone's life was devoted to that person so your brain neurons and triggers are programmed towards that chapter in your life, that it just slips.
I hope this helped.