If you cannot see anything via i2cdetect then there is little chance of you getting any code working. Start by checking the hardware.
You will need four connections: ground, power, and the two I2C lines (SDA and SCL). The power to the I2C device might need to be 3.3V or 5V, so check which, and make sure it is the right level. Regardless of whether the power supply comes from a 3.3V GPIO pin or 5V GPIO pin on the Pi, or from a separate source, the ground will need to be linked with the Pi, so if you are using a separate power supply for the device then the grounds will need to be linked. Then check the SDA and SCL lines are connected the right way round. This is probably the easiest mistake to make.
The next stage is to check what voltage the I2C device considers logic high. If it is powered by 3.3V then logic high will also be 3.3V and connecting directly to the GPIO pins will work. However, if it is a 5V device then the minimum voltage for high will vary depending on exactly which technology is used (CMOS, TTL, etc). There is some variation between different devices, but generally 5V TTL devices consider anything above 2V to be high, but 5V CMOS devices might need 4V for high. You might need to use a logic level shifter if the threshold voltage is above 3.3V.
Although the accelerometer datasheet (https://www.nxp.com/docs/en/data-sheet/MMA7660FC.pdf
) describes it as a low voltage device which would be perfectly OK at 3.3V supply and logic, it may be mounted on some kind of carrier board which expects a 5V supply. If you can get the arduino to see the accelerometer, then this is the case, as that is what the arduino uses.