Generally, it is ok to think about a difficult problem for 30 minutes. If it is relatively uncomplicated, you can appropriately reduce the thinking time, such as 15 minutes. If you still can't figure it out, I suggest you find a teacher to explain. When the teacher explains, it can also be extended to the same type of questions. Don't try to look at the answers by yourself. If you don't remember some formulas in the answer, ask the teacher to make up for them.
In addition, it is very important to listen carefully in class. You can teach yourself for 30 minutes, not 10 minutes. What the teacher said in class is very important and systematic. It is more efficient to follow the teacher's rhythm than to grope for it yourself.
More importantly, there are a lot of knowledge points and learning contents in high school now. The teacher's class time is limited. I missed a lot of knowledge points, so I don't know when I can hear them again. Moreover, it is very obvious that listening to lectures carefully is helpful to self-study and practice doing problems. You have all the knowledge points in mind, just take them directly when you do the problem.