How does one determine what size I-beam is needed?
Go to college and earn a degree in civil engineering.
Take and pass the EIT Exam.
Get a job in the business of determining appropriate beam sizes for varied projects and work there under the supervision of registered engineers for 5-10 years or so.
Get the recommendation of 2-3 of these engineers and then take and pass the PE Exam.
Congratulations!  Now you are qualified to make such determinations.