First, find out exactly what you're accused of
An FIR (First Information Report) is the police's formal record of a complaint for a cognizable offence, and it names the sections of law allegedly violated. Getting a copy — or at least confirming the exact sections named — matters immediately, because it determines whether the offence is bailable or non-bailable, which changes your options considerably.
If you haven't been arrested yet
If you believe an FIR has been or is about to be registered against you for a non-bailable offence, an anticipatory bail application (under BNSS Section 482, the provision that replaced the old CrPC Section 438) can be filed with the Sessions Court or High Court before any arrest happens. This is specifically designed to be sought early — waiting until after arrest removes this option entirely.
What to do, and not do, if questioned
You're entitled to consult a lawyer, and the Supreme Court has held a lawyer may be present during questioning, even if not necessarily throughout. Getting legal advice before giving any written or recorded statement is one of the highest-value things you can do early on, since statements made to police can be used later and are difficult to walk back.
Why speed matters
The wording of the FIR, whatever statements get made in the first day or two, and how quickly anticipatory bail is sought if applicable, can all materially affect how the rest of the case unfolds. This is one area where waiting to "see how serious it gets" before speaking to a lawyer is usually the wrong call.