Enemy logic

Hello, new in making games but I can load json tiled maps and do some collisions with characters but now I just need a logic for enemies and my character in my game. I know that if my character’s sword animation sprite overlaps the enemy’s sprite the enemy should get killed but I just need code for doing that. Please help me