In what contexts would I use 由?
In your example '由' means 'by'. To give you more examples,

发动机是由蒸汽驱动的。
The engine is driven by steam.
这首歌是由歌手自己创作的。
The song is written by the singer himself.
小区里的足球场是由大家共同维护的。
The soccer field in the neighborhood is maintained by the community.