1. Wait until classes start to buy textbooks. You want to have a chance to talk to your actual professor and hear what they say about the textbook and/or look at the syllabus to determine what, if any, readings are actually required from the textbook. In many cases, textbooks are chosen at a departmental level, so some professors may use them sparingly or not at all.
2. If you determine that the textbook is probably needed for you to finish the course, and there is an older edition available less than 5 years old, then buy the older edition. It will be available online on eBay, Amazon, etc. for a much cheaper price than the most current edition. In most cases, the reading content will be very similar, if not identical. Problems sets might change, but if you are assigned them, you can ask another student to take a look at their textbook, or borrow one from the school library. I started doing this my last couple of years at college, and never had any issues.
3. If you do buy a textbook, read it in its entirety. Remember that you are taking classes to learn, not to blindly follow a course syllabus. So read your textbook - all of it - even the parts that aren't assigned.