In what way can I get pink eye over night?

Not overnight. Your exposure to bacteria can take 24-48 hours to result in clinical conjunctivitis. You may have symptoms when you wake, but the exposure was long before you went to sleep.