You should talk to the professor, and make an appointment with your advisor. If you are a first year student, you should also be in touch with COMPASS. Academic difficulty is a serious problem, but not an uncommon one–the university has many resources to help you manage.
Here are some policies (withdraw dates, refunds, etc.) on withdrawing from the university and dropping classes.