Animate an object along the z-axis in a sin wave
You can use the Graph Editor for this by adding Modifiers.

Simply add a single keyframe to your object's Z-Coordinate (right-click the property in the Property panel (N) and select 'Insert Single Keyframe') and then swap to the Graph Editor.

In the Modifiers properties panel add a Built-in Function, select 'Sine', and adjust the properties (Amplitude, Phase Multiplier, etc.).