Karl Popper read about Sigmund Freud's theories and listened to Albert Einstein's lectures which helped him formulate the theory that makes "pseudoscience" (as he coined it) and "science" distinct.
What he realized is that Sigmund Freud could warp evidence to conform to his theory. For example: Sigmund Freud could explain how a child might feel lonely by explaining that they were hugged too little as a child (lack of affection; induces alienation to affection) or being hugged too much as a child (affection becomes a normal occurence it is taken for granted). Sigmund Freud seeked to prove his theory which ultimately leads him to cognitive dissonance and bias--something unscientific.
Albert Einstein did not do what Sigmund Freud did. What Albert Einstein did sounds counterproductive, but he seeked to disprove his theory. The solar eclipse of 1919 was heavily watched by Albert Einstein as the way light would travel to Earth would've disproven the Theory of Relativity, but as we all know, it becomes the most well-known scientific theory today. (The solar eclipse proved the Theory of Relativity as Einstein observed how the light warps or bends)
What seperated Sigmund Freud and Albert Einstein was unorthodox and seemingly contradicting, but we can never trust how we "feel" but rather what we "know". We know that theories that seek to disprove are scientific because they do not have the bias that a theory that would seek to prove. It sounds weird, I know, but Karl Popper thought that seeking to disprove eliminates more bias than seeking to prove ever would.
In his eyes, every "wrong" theory that we assume gets us that more closer to the truth, because we have just crossed off one wrong idea to be replaced with a right one.