first you go house to house and clean out any active resistance.
once active resistance has ceased, you send in your military police, secret police, secret service, intelligence agencies, etc to find and arrest any and all people involved in running the hamas organisation, and confiscate all its property. with that, the organisation in its current form will have ceased to exist and lost its entire power structure.
will a small fraction of hamas fanatics make it out of gaza and reconstitute elsewhere? that's possible, yes. but then they'll be just one in a million small islamic jihad movements with a couple dozen or hundred guys at most, they'll no longer be a local government in control of a territory of 2mil population. it would be a massive fall from grace, and at that point it'll no longer be israels concern.