The act of "due diligence" is simply an investigation of the property that is to be purchased or leased by the buyer or tenant prior to the signing of a binding contract. The following categories of when, where and how should provide you guides for successful due diligence.
The best answer for this is simply as soon as possible. The only thing you need is access to the property and perhaps insurance. Upon execution of a contract you should start the process and not wait for anything. Time is going against you and information is king! The costs at the beginning should be minimal but if not carefully performed, the costs can be gigantic!
A simple question but perhaps not one you can answer readily. It should be obvious if you are purchasing an improved property then the roof, HVAC, soil, structural and paving should be inspected.
First visit the Planning/Zoning Department at City Hall and make sure the use that you intend to use the property for has the proper zoning. If your use requires a conditional use permit then you will require more contingency time in the escrow process to achieve this approval. The next step at City Hall is a visit to the Building Department and request at the counter the permit package that is associated with the construction of the building. Make copies of all permits and "keep them". Also ask at the building department if they require a pre-sale inspection of the property which may be eye opening.
My personal recommendation is to employ separate contractors for each category that you intend to inspect. Therefore, you should call your favorite plumber, electrician, roofer etc. If you do not know qualified contractors, the best place to usually find them is through your local real estate broker.
If you intend to improve or add to the property, then the employment of an architect or structural engineer can be critical in your decision making process.
You may be purchasing the property "as is, where is" but that does not alleviate the seller's need to disclose any inherent issues concerning the property. If the seller has not presented you with a "Mandatory Disclosure" document, then request it. If you and the seller are represented by the same broker, then demand that the broker investigate any possible issues that may be inherent with the property (it is their duty to disclose). If you do not share the same broker, then instruct your broker to request from the seller's broker to investigate any issues that may surround the property.
All of the items mentioned above can apply to the sale of the property or a long term lease. All of this information should be critical whether you are a tenant or a prospective buyer.
The last item to mention is to make sure that you take photos or even better a video of all of the property and its improvements. Place all of those materials in a safe place for possible protection in the future.