Each court may enforce by attachment the return of any writ or process issued out of the same court and the payment of moneys had and received by any sheriff, coroner, constable, attorney, or collector in his or her official capacity, and the delivery of papers entrusted to him or her officially, and unlawfully withheld.