Visit their website to secure a timed entry pass for a certain month in advance, or check early in the morning for same day tickets, or walk up passes are available during the week.
We just visited the museum a week ago. We went to the website at 6:30 am which is the earliest time get get tickets and all the times were available. Probably because schools are in session.
If you don't pre book tickets you can get some walk up same day tickets on weekdays after 1p. Check here https://nmaahc.si.edu/visit/passes for more details
Thanks! Your answer is awaiting moderation.