Here is an example of how to do a problem where we have a system of objects tied together, and need to find acceleration and a couple tension forces. These tend to be confusing when we first learn the process of applying the 2nd law, but with some practice and using the same strategy every time for a system, we'll get it down. The strategy is to draw the force diagram (always!), do F = ma for the entire system to get the acceleration, then isolate individual objects and do F = ma on those to get internal forces. Check it out!