Start by practicing on the surface, by holding your nose and swallowing, or blowing gently (valsalva Maneuver). You should feel or hear a flutter in your ears as the pressure change moves the ear drum. Assuming that works, and you get comfortable doing it at will, you should be able to replicate it in the water under the proper conditions.
The limiting factor for most newbies encounter is depth change. The problem is that they simply wait too long to start equalizing and by the time they think about it, they're fighting an uphill battle. You'll hear the phrase equalize early and often repeated by experienced divers, but probably don't grasp how early or often.
You can't start too soon, because as you descend the external pressure on your eustachian tubes begins to press them closed, the same way that the vacuum collapses a straw when you try to drink a thick shake too fast.
Non-pressuring techniques only work up to a difference of a few feet, and after 4 feet you'll need pressure techniques like the Valsalva Maneuver. Beyond 8 or 9 feet of unequalized depth change your tubes will be squeezed flat and equalization will be next to impossible. BTW that's about the depth change at which most people feel mild pain.
So don't wait to feel the pressure difference, start equalizing the moment you start descending, and continue to equalize as fast as you can, staying ahead of or at least equal with your descent rate. If you feel pressure, go back up until equalized and start again.
By the way, equalization is a skill which needs to be learned and practiced. It doesn't always come automatically, and there are many techniques available, with each diver having his favorites, but nothing solves the problem caused by waiting too long.
Lastly, when on actual dives resist the temptation to chase the instructor or other divers down (it'll be a strong urge), and let your ears be the boss. If you can't equalize as fast as you descend, descend as slow as you can equalize.