The problem is exactly what the linked stated. You've defined the object 'modem' in sim.h. But, sim.h gets #included in both the main .ino file and sim.cpp. So now it's defined in two places. Those two files get compiled without issue. But, when the linker tries to resolve the references and put everything together it finds two definitions of the same object.
Variables (objects) should only be declared in the .h file. See: https://www.geeksforgeeks.org/difference-between-definition-and-declaration/
You can also see My Post #5 Here for a basic guide to breaking projects into separate .cpp / .h files.