Lying to authority figures is something I have gotten good at over the years. These steps are what I do to keep out of trouble. This is going to take some practice before you get it right for yourself. This isn't something you can learn overnight, but if you get good at it, it will save your neck in the end.
Step 1: Stay Calm
Remember, you're innocent even if you're not. You have nothing to worry about.
It helps to convince yourself that you are telling the truth to begin with. You can not be lying if you don't think you're lying. You might be delusional, but that doesn't matter since you have convinced yourself you are telling the truth.
Step 2: Speak in generalities
This sometimes works if the person is stupid enough. If your person is good at interrogation this is only going to make them angry. Trust me.
It's good to offer as few details as possible. Only give details if asked for them. Details can be used to unravel lies.
Step 3: Be prepared
Think of it like a test or a job interview. Think before hand of the questions that this person might ask and rehearse the answers to yourself. Remember to keep the answers short and to the point. Don't provide needless details or bad alibis.