Harry Potter has often shied away from issues like sex or drug abuse because in the end, it's set in a fairy tale world where years of emotional and sometimes physical abuse has not left Harry an insecure wreck.
It's an idealized world with well defined villans and heroes and very few moral grey areas. Therefore gritty realism and issues like Teen pregnancy etc. doesn't really have a place in Harry Potter series something the author herself agrees with:
I feel it would be inappropriate-in these books -were Hermione to have an underage pregnancy or if one of them were to start taking drugs, because it's unfaithful to the tone of the books. It's not at all that I don't think those themes can be explored superbly in children's literature. It's just that in the Harry Potter books there isn't a place for those particular issues.
Now if one were to move away from JK Rowling's opinion on this issue, it would be rather easy to induce a abortion using muggle means.
In muggle means we have Misoprostol with up to 90% rate of abortion. The muggleborn students are sure to have heard of this drug and would use it in case it's required.
Magical means, I don't think exist since the population of magicals is so low, they would not bother developing effective contraceptive or abortion methods. Most pureblood families have one offspring, Weasleys being the exception. However its not unlikely for them to use muggle means like condoms/contraceptive pills for protection if they know about it.