Generally this takes the shape of “the morning after pill”, known in the U.S. as "Plan B". This is available over the counter from most pharmacist for a small cost, or under some circumstances from a hospital emergency department. Read this Info Sheet from the Royal Women's Hospital for the details, or check out this video made for young people.