The pre-money valuation is what you are worth before the investment. So you're saying "we have a company worth $10 million" and the investor is saying "cool, let me give you $5 million."
So now you have $10 million in company plus $5 million in cash, so you are worth $15 million (that's called the post-money valuation.) The investor gets $5m / $15m—33% of the company.
Worth of company before investor gives company cash (pre-money valuation): $10 million
Worth of company after adding $5 million from investor: $15 million.
Investor now owns $5 million dollars "worth" of a now $15 million company
$5 / $15 = ~33%
How do these calculations work?