If you're having trouble on a trial, look for different routes. Some tracks, such as those in Martinsville, don't have different routes. If you can find a different route through a track and you are struggling to hit the time requirement, give it a shot.
Make use of drifting. If you have a boost going and you can drift through a corner and keep it off the walls, it could make the difference between hitting the time and not.
Always try and hit through the pits for an extra boost. If you have an active boost and go through another checkpoint or the pits you will store a boost which can be activated immediately after your current boost is ended.
If all else fails, just take a break. Come back after you've done something else to help relax. Your fresh head should make it a little easier for you to nail the time.