tocar vs jugar
Both can relate to playing — jugar is playing games/sports, tocar is playing instruments and also 'touching.'
tocar
To touch, and to play an instrument — plus several idiomatic meanings around turns and luck.
Toca la guitarra desde los doce años.
She's been playing guitar since she was twelve.
Instruments always use tocar. Jugar la guitarra is wrong.
Te toca a ti.
It's your turn.
Tocar = to be someone's turn. Completely different from playing or touching.
Me tocó la lotería.
I won the lottery.
Tocar for luck — something coming to you. 'Me tocó' is how you describe a windfall.
jugar
To play games, sports, or to gamble — activities with rules and outcomes.
Juegan al fútbol todos los domingos.
They play football every Sunday.
Sports and games use jugar. Note: jugar al in Spain, jugar fútbol in Latin America.
De niño jugaba mucho con Lego.
As a child I played a lot with Lego.
Play as a child's activity — jugar.
Juega con fuego.
He's playing with fire.
Figurative: taking dangerous risks. Idiomatic use of jugar.
Tricky bit
'¿A qué juegas?' = What game are you playing? '¿Qué tocas?' = What instrument do you play? Confuse them and you get: 'toco al fútbol' (I touch the football — odd) or 'juego la guitarra' (wrong). The rule is strict.