Let $p(n)$ be greatest prime factor of $n$, denote $A=\{n\mid p^2(n)\mid n,n\in \mathbb N\}.$
$A=\{4,8,9,16,18,25,27,32,36,49,50,\cdots\},$ see also A070003.
Define $f(x)=\sum_{\substack{n\leq x\\n\in A}}1.$ Erdős proved that $$f(x)=x \cdot e^{-(1 + o(1))\sqrt{\log x \log \log x}}.\tag1$$ Hence $f(x)=o(x),$ $$\lim_{x\to \infty}\frac{f(x)}x=0,\tag2$$ since $(2)$ is easier than $(1)$, can you prove $(2)$ without use $(1)$?
What follows is self contained proof that $$f(x)=\sum_{\begin{array}{c} n\leq x\\ n\in A \end{array}}1 \ll x e^{-c\sqrt{\log x}}.$$ If you work more carefully with the friable integers, you can recover Erdős' result.
Remark: Erdős' result may be recovered in the following manner: First, to obtain the extra $\sqrt{\log \log x}$ in the upper bound, you need a bound of the form $$\Psi(x,y)=\sum_{\begin{array}{c} n\leq x\\ P(n)\leq y \end{array}}1 \ll x u^{-(1+o(1))u}$$ where $u=\frac{\log x}{\log y},$ rather than Rankin's trick. Now, the asymptotic can be obtain by bounding the second term in equation $(1)$, and noticing that the first term will provide us with our main term.