How can I attach a Technic Linear Actuator to a EV3 Medium Motor?
First of all, let's identify the parts you are trying to attach.

The EV3 medium motor is a pretty accurate description, I'll assume it means this.

The linear actuator is more ambiguous, it can mean both the smaller and the larger variant.

For the smaller one, I'd use two 3 x 3 technic beams or two technic triangles, one on each side of the motor, attached by technic pins in the first case or half-pins in the second. The axle can be connected via an axle joiner.

For the larger actuator, I'd use two quarter brackets and two hybrid beams for spacing.