pegar
Pegar means to hit, to stick and to match — three unrelated meanings, plus a family of 'give a shout/jump' expressions.
pegar (hit/stick)
To hit someone or to glue/stick something.
No pegues a tu hermano.
Don't hit your brother.
Hitting. Pegar a + person.
Pega la foto en el álbum.
Stick the photo in the album.
Gluing. The noun is 'pegamento' = glue.
Se me ha pegado el arroz.
The rice has stuck to the pan.
Pegarse = to stick, to burn on the pan, or to catch (a habit).
pegar (match/idioms)
To go with or suit, and to deliver a physical action: a shout, a jump, a fright.
Esa camisa no pega con los pantalones.
That shirt doesn't go with the trousers.
Pegar con = to match. Informal.
Pegó un grito.
He let out a shout.
Pegar un grito/salto/susto/portazo = to shout, jump, frighten, slam.
Pega fuerte este verano.
It's hitting hard this summer.
Figurative: a trend or season arriving strongly.
Tricky bit
'Me he pegado con la puerta' = I bumped into the door. Whether pegar means 'hit' or 'stick' depends on context, and the reflexive adds a third reading: to catch something (pegarse un resfriado).