hi i just started mountain biking and i would like to change my front forks and my brakes.

now, I am not sure what fits what....yet alone, what size fork i need. I see so many things like 80mm travel 100mm travel 1in dia tube and a 1 1/8 in dia tube

ok so..how do i determine which one i need? and what fits my bike (trek 4900)
also, for the disc brakes how do i tell what brakes fit what? I seen 140mm 160mm 180mm 204mm..ect

and i seen 74mm post mount and 51mm is mount.... can someone please explain to me how to see what fit what and what is the size of the rotor mean? do they all fit one or i have to get, lets say, a 180mm for the front and a 160mm for the back

and how do i know which one would fit the rear?

thank you so much for the help