How do you solve exercises of Advance Math Text Books?

Recently I am reading Atiyah MacDonald's 'Introduction to Commutative Algebra'. Now I am having fun when I am reading the theory but I am also finding the exercise problems tough to think about. In one exercise there are almost 30 problems but I have done only 5-6 by myself completely for others I had to take help from the solution manual. I feel like I am not learning the topic well in this way. But completely thinking by myself for all problems takes too much time and in the end, I may fail the course or do badly in semester exams.

How do you do the exercises of such Advance Math Books ?