birds hidden in nests from fear of cold

is this sentence correct?

It's not a sentence. It's a fragment.

http://www.chompchomp.com/terms/fragment.htm

its for my poem just wanna know is it okay?

Yes, the sentence "birds hidden in nests from fear of cold" is grammatically correct. However, it would be more precise to say "Birds hide in nests out of fear of the cold." This sentence conveys that birds seek shelter in nests due to their instinctual fear or dislike of low temperatures.