I worked as an executive assistant for ten years. (job)
He used a pair of scissors as a weapon to defend himself from the attacker. (function)
We use like to make a comparison:
That cloud looks like a dragon.
She sings like an angel.
ne difference is that as is used when something truly has that job or function, and like is used when something is similar, but not really the other thing. Compare:
Brad Pitt works as an actor.
(Brad Pitt is really and truly an actor)
John looks like Brad Pitt.
(John is not really Brad Pitt, but he has a similar appearance)
We can also use as if to talk about something that is similar (but not really the case):
When I'm skiing, I feel like I'm flying.
When I'm skiing, I feel as if I'm flying.
Barbara acts like she's superior to everyone else.
Barbara acts as if she's superior to everyone else.
We can use both such as (more formal) and like (more informal) to introduce an example:
I prefer science fiction movies, such as Star Wars.