Adding Optgroup in Drop-down form fields


How can I add optgroups to the drop-down form field options?
I want to make my drop-down look like this(attached image), the options marked with the arrows are the optgroup labels.

I would appreciate any kind of help from the experts please.


Yeah, would like to do that too…