Great question and it's one I was concerned with too when applying to universities. I received some advice when I was applying and I wanted to share that with you.
The school will be as big as you want it to be. You can sit in the back of the class or lecture hall and get lost in the crowd or be consistent and sit close to the professor, meet with them outside of class for help (or just to network), and never shy from asking questions. Outside of the classroom, since there are many students, you'll have so many people in the same position as you and you'll be able to make friends by being yourself. Somehow in a school of 40,000 students, people gravitate to find one another. I found many of my close friends now by accident.
Overall, there are opportunities to have a good relationship with your professors, classmates, friends, etc. it's just a matter of managing your time and resources well. Take advantage of office hours and visit your professor for help and advice. There are students just like you every year, so they are fully capable of answering questions.
In the end, it's personal preference. Luckily, many smaller schools offer great degrees, so if you really feel uncomfortable at a bigger school that's fine! For me, I ended up loving the big school setting after experiencing it. So you may even surprise yourself! Best of luck and no matter where you go, work hard and it will all pay off!