First off, you need to know what the terms mean. Then, you can apply them.
Piano, (written as a 'p') is a dynamic marking indicating for you to play quietly.
Forte, (written as an 'f') is a dynamic marking indicating for you to play loudly.
Legato is a musical style, telling you NOT to separate notes but play them smoothly, or in other words, together.
When there is an 'm' in front of any dynamic marking, it means 'mezzo'. For example, 'mezzo piano' would be to play sort of soft, but almost loud.