All that is required to become free of the ego is to be aware of it, since awareness and ego are incompatible.
Awareness is the power that is concealed within the present moment. This is why we may also call it Presence. The ultimate purpose of human existence, which is to say, your purpose, is to bring that power into this world. And this is also why becoming free of the ego cannot be made into a goal to be attained at some point in the future.
Only Presence can free you of the ego, and you can only be present Now, not yesterday or tomorrow. Only Presence can undo the past in you and thus transform your state of consciousness.