1. Used to indicate proximity. Example : Can I sit by you?
2. Used to indicate the person that does something in a passive voice sentence. Example : The microwave was fixed by the mechanic.
3. Used to indicate an action with a particular purpose. Example : You can pass the exam by preparing for it.
4. Used to indicate a mean or method. Example : Please send this package to Russia by airmail.