How can I buy mechanical and electronic components online?

Hello. I am a university student majoring in Mechanical Engineering. I want to start building some things for fun. Can you please tell me how I can buy mechanical and electronic components online. Thank you.