That's exactly what you do when programming. I don't know how to code a database server web page. But i can look at that and say "well, i'll need a form to get the input, a database connection, a way to run queries, and a way to display the data". I don't know how to do any of those four things, but I can pick one, break it down into smaller pieces and see if I can solve those. If not, I pick one, break IT down, and keep repeating.
Math classes are like exercise for your brain. They teach you how to think, how to analyze problems.
Will you ever have to write code to solve differential equations? probably not. But the skills you pick up CAN be applied to programming.
Think of math and science as tools on your toolbelts to better understand the core concepts of computer science. Using the scientific method to debug a piece of code can go a long way to solving your issue in a logical and straightforward way, but it's just an array of tools at your disposal.
The same goes with math, though this one is more dependent on specific aspects of computer science that are interesting to you. If machine learning and AI are interesting to you, having a solid grasp of Math is going to really aid your understanding of those advanced topics. If you think you'd just like to use a computer science degree to do web development, math is still important, but less impactful in your day-to-day role.
There are several areas of Computer Science where Math skills are directly applicable.
ML/AI - Linear Algebra, Multivariate Calculus, Statistics foundations is required - two course sequences on Coursera give you an idea of Math for ML/AI - https://www.coursera.org/specializations/mathematics-machine-learning#courses , https://www.coursera.org/specializations/mathematics-for-data-science#courses .
Software Development in areas such as Graphics and Animation (Computational Geometry - Geometry, Physics of movement, Physiology of humans and animals), Computational Physics, Computational Engineering topic such as Fluid Dynamics (airflow of a airplane), Building Structure Design etc. applies math skills directly.