Most probably it was a (rather primitive version of) cervical cap.
According to this detailed article Marie Stopes recommends it in her book Married Love (the one that Mary was reading), although she also mentions other methods of anticonception.
However as someone in this discussion correctly noticed we have more clues suggesting it was the cap:
Firstly, the references are always to a single item. Lady Mary poses, "Why shouldn't you buy one?” Later, after Anna threatens to spite the chemist by buying a baker’s dozen, Mary replies that “one’s enough for now.” Surely one single condom would not have sufficed for a weeklong sexcapade. I supposed you could interpret that ‘one’ as ‘one box of condoms’: technically possible, though it sounds like an odd turn of phrase if you replay those scenes. But when Bates discovers the mystery object, he refers to it as “a cunning piece of equipment.” A cervical cap is a cunning piece of equipment; ditto a single condom. But a box? Hardly. If she had bought condoms, the references would be plural, not singular.
More importantly, Bates accuses Anna of ensuring there’ll be no baby
Bates – in other words, using the contraception without his knowledge.
A cervical cap could be discreetly popped in without a husband being
any the wiser. But it strains credulity to assume Bates believes Anna
has been sneakily sheathing him up, each time they have sex, without