Stop using 4chan/reddit/other social media sites, and stop consuming degenerate media (anime, tv, manga, etc.)
for hobbies listen to classical music and read actual novels (not light novels or pulp fiction), and more importantly try to understand what you’re listening/reading.
also try to keep masturbation to a maximum of one time a day. if you can do it even less than that it’s optimal, but not everyone can