Upvote:2
There is no issue with doing this, as long as you leave the US having followed the visa requirements, and that you apply using the ESTA (Electronic System for Travel Authorization) website on both occasions well before you board your flights.
Particularly on your second visit, you may be asked some additional questions, like:
They can demonstrate the intent to stay 90 days or less in the United States and demonstrate sufficient funds to support themselves while in the United States. Learn more on the CBP website.
More info on the US Department of State's travel site.