مَفْعُولٌ مَعَهُ is the mansub noun that comes after a waw carrying the meaning with.
That waw is called وَاوُ الْمَعِيَّةِ — the waw of accompaniment.
Use 3 checks:
1. Is there a وَ?
2. Does it mean with rather than merely and?
3. Is the following noun mansub?
When all 3 agree, the noun after waw is مَفْعُولٌ مَعَهُ.