There’s a hotel right in the airport (just outside the Security Checkpoint in Terminal E.

If that doesn’t fit your needs just about every hotel chain has a place within 1 to 3 miles of the airport - many provide free shuttle service. Google “Miami Airport Hotels” for links.