How to remove residue from underlay?

My partner went to remove the carpet at our new place while I was work, and the underlay left all this black glue(?) What's the best way to get all of it off? The second picture, the underlay came off without issue.