Serial Value to a function how do i?

Hi, im new in the world of Arduino programming, and I have a question if anyone could help me I would be very grateful. The question is, how can I make a serial value into a function in Arduino? For example to turn a motor on.

I will be very thankful with any help you may give,

Datnoob