There are a few components which are necessary to become good at jiu-jitsu and one of the most important is drilling. But so many people waste their drilling time; some by not drilling at all and some by not drilling efficiently. Drilling is also a skill in itself and you can learn to get better at it. So here's a few pointers which will hopefully help you improve how you go about it.
A lot of people think that just drilling as many times as possible is the most important thing, and although it is good to do as many reps as possible during drilling time the most important part of it is to make sure you are drilling correctly. This means you need to be completing every step of every rep properly, copying exactly what your instructor demonstrated not just doing what you think you should do. So when you first start drilling do it slowly, step-by-step, and make sure you can remember each part of the technique and perform each movement necessary. Don't spend your time drilling something incorrectly, if something feels awkward you're probably doing it wrong. If you can't get it to work, or you're unsure, call your instructor for help. Only once you are sure you're doing it right should you start picking up the speed at which you're drilling. Start by trying not to pause between steps of the technique and then once you can do that build up the speed.
Don't stop drilling because "you know the technique now". Trust me, you don't know it well enough. You can always improve and make each transition tighter, smoother and more intuitive. Even for higher level practitioners there is always a benefit from drilling the muscle memory more and the benefits of simple physical movements (muscular endurance and cardio).
Only drill what the instructor has shown you. More advanced students can throw in some variations they know, or finish the technique in a variety of positions, but most people should just be drilling exactly what they were shown and nothing else.
Don't spend drilling time discussing the technique or anything else. Discussing jiu-jitsu is not going to help you improve your physical skills, discussing random things is not going to help you in any way whatsoever. Some talk about the technique you're doing is ok, but it should be relevant.
Make sure you start and end each rep in proper position. You are not there to just learn the middle part of a technique, so begin with the position properly set and never do stuff like sweep but don't bother coming up to top position. The whole movement from beginning to end is important and taking any short cuts will give you bad muscle memory.
Only ask questions which relate to the technique you are learning. If you've just been shown a butterfly sweep don't call your instructor over to ask about a mount escape. Lots of people are in a rush to learn everything as quickly as possible but jiu-jitsu is a slow process of small, incremental advances.
Apply submissions slowly and gradually. There is never any reason someone should get injured during drilling so don't apply armbars like you're trying to tap somebody in the Mundials final. You might also be drilling on someone much less flexible than your instructor demonstrated on, so don't assume you know how much pressure/movement is safe to apply. On the other side of things don't stop trying to apply a submission before your partner taps; your instructor may well have only had to apply a small movement to get a tap on their demonstration partner, but they are much more experienced and will be able to apply things much tighter. Just go slowly and gradually until the tap. If you can't get the tap ask your instructor for help.
Remember there are two people involved in drilling, so being a drilling partner is as important to do well as drilling for yourself. You shouldn't resist against techniques at all; it's easy to stop one technique when you know what is coming, but that's not what drilling is for. You should allow your partner to complete the technique without trying to prevent them doing so, but don't just let them do anything. If your partner is doing something wrong point it out to them (if you are sure about it!) or if they are trying to do something like sweep you the wrong way then post with your free arm and stop it. You shouldn't be resisting, but you also shouldn't throw yourself into sweeps or just collapse to your back from the slightest of movements. Drilling is a two person exercise aimed at improving your technique.
Advanced students can also start to offer more resistance (but always remembering your partner is only trying to do one or two techniques) and variation in how they base/balance. This allows your partner to feel how the techniques will work in a more realistic situation and work on minor variations. This is less advisable for novice students though, as they need to just learn the basic technique before worrying about what ifs.
Don't try to teach your partner. If they have issues/questions about the technique ask your instructor. Advanced students (at least purple belt) will be able to help with a lot of stuff but even they will be better off referring to the instructor and white or blue belts should never try to show specifics. For this reason I think it can also be dangerous for lower level students to arrange to drill away from class. If it's stuff you have drilled before and know fairly well, or you have an advanced student to oversee the session, it should be ok but don't drill new stuff you have seen somewhere as you could be learning something totally wrong. You'd be better off spending the time sparring.
Both people should also give and ask for feedback throughout the drilling. If your partner is drilling on you and should be controlling an arm but isn't keeping it tight, let them know. And if you're the person drilling the technique then ask your partner if everything feels tight, or if they feel properly off-balanced during a sweep etc.
Sparring is where you will improve your fighting ability but drilling is where you learn the techniques which will help you improve, so give it your full effort and make sure you learn the techniques well. Drill hard but drill correctly!