If they accept my cash offer for a property, do I have to send money before or after closing and title search?

I was told that it will take 30 days for the closing and title search. We send the check before or after? (I’m not comfortable about sending money, because if there are problems with the title, I could lose my money)