Be careful when you cross the road.
Don't worry be happy.
These are made up sentences.
What is the grammatical form and function of "be" in "be careful and be happy "?
Is the first one imperative?
I am not sure of the second type - be happy
Why do you seem more sure that the first is an imperative than the second? What difference do you see between them?
You say they are made-up sentences, by which I assume you mean you made them up. So you probably know what you mean by them. Please tell us what you mean by them and what difference you see between them.