Constraining the early universe with primordial black holes