Looping n times, calling rand(n) and putting the random element in the output. This mostly works, and is actually far better, in space and time,
Reservoir sampling is normally used on large streams where you do not want to or cannot keep the data you are sampling from in memory.