How to get previous months in the select fields dynamically

Hi Everyone hope you guys are doing well.
i want to know how can i get previous 6 months in the select field options .
Thanks.