Does plan B really work after sex?

Thoughts in how good it works and will it prevent from getting pregnant?!!!