Why consider only $x$ component of accelerating block pulled by cord at an angle? 
A $5 \, \text{kg}$ block is pulled along a horizontal frictionless floor by a cord that exerts a force $F=12 \, \text{N}$ at an angle $\theta = 25 \, \text{deg}$ above horizontal. What is acceleration of the block?

Why, in looking for the acceleration, do we just do $12 \cos25 = 5(a)$?
Why don't we also look at the $y$ component $12 \sin25$ and then find the magnitude of $i$ and $j$ ($x$ and $y$) by doing the whole square root of $I^2$ and $J^2$?
 A: To add to Steeven's answer, the vertical component (here the sine 25 component) of the applied force is used up, alongside the normal force of the ground, in balancing the weight of the block. The result of this is lowering the normal from the value it would have had if the applied force had been horizontal. In the given scenario, the vertical component of the applied force isn't enough to reduce the normal reaction to zero, i.e. to lift the block from the ground by accelerating it. In other words, the vertical component would have led to acceleration in vertical direction as well. As it is said that the block moves horizontally only, it is understood that the vertical component of the applied force is used up only to balance a part of the weight of the block, and not in accelerating it.
A: The key background concept to understand here is resultant force.  All the forces on the block have to add up to one force which actually accounts for its motion.  Some simple graphics are at BBC and some more complex ones at PhysicsClassroom.  One consequence of the ability to just add up forces like vectors is that the x component of this force (12 N)(cos 25 degrees) can be considered completely independently of the y component.  You can add them up when needed to get the total motion or use them individually to get x and y separately.
The trick to working with resultants is you have to notice all the forces, including the ones the book doesn't tell you about.  Here, you're pulling the block up at a 25 degree angle ... but it's not moving up at a 25 degree angle.  Why not?  Well, because it's heavy.  So there is actually a second force, gravity, to be considered.  But gravity is not the whole story either, because the block is not swinging down through the floor!  So you need a third force, namely the contact force [presumably Van der Waals repulsion between the molecules of the block and the floor or lubricant].  You can calculate all those in the y axis - your 12 N sin 25 force pulling up, your 9.8 m/s^2 * 5 kg pushing down (assuming you're on Earth), and the floor ... providing whatever force it takes, however small or large, to make it all come out to zero.  Because the block isn't actually going through the floor, and the resultant force you get has to explain that.
Because that is all a wild goose chase, people here will tell you to just consider the x component.  If the floor is actually a weighing scale and you want to describe how the number changes every time you tug on the cord, then you would need to do that part of the calculation ... otherwise, be content you know what it has to come out to.
A: Your goal is to find the acceleration. So let's look at that. Since you are told that the box moves over the surface, you then know that this acceleration is along the x direction. 
I will always start like that: Make sure you know what you are looking for, and then look in the direction where it appears. 
By using Newton's 2nd Law in the x direction, you'll take the force components as you did, and equal them to $ma$. Since this $a$ is exactly what you are looking for, you don't need to do any more than this. This is enough. 
Only if you have more unknowns - like if you didn't know the value of a force that is acting on it in the x direction  - you will have to look into other directions also to get more equations. 
A: Here's my take. It's not good enough to say that you only look at the $x$ component because that's what you are asked to find. Newton's laws of motion always apply regardless of what the question asks for. 
So let's consider the $y$ component. The free body diagram would show you that you have the weight of the object, the normal force, and the $y$ component of your external force. If you decompose your external force for its $y$ component, you get
$12 \sin{25^\circ}=5.0\:N$ up to the same sig figs as the given force. 
But you still have the normal force to consider. Just like Arkya Chatterjee said, your normal force will now be reduced from this 5 N $y$ component of the external force. But it won't be reduced to zero. 
Therefore, after all the forces in the $y$ direction are considered, you end up with the net force along $y$ of zero. Hence, no acceleration in that direction. 
A: The simple explanation is that the $y$-component of the force is not strong enough to overcome the weight of the block, so the block effectively stays on the surface: $$F_y = 12 \sin(0.436) \approx 5.06 \, \text{N}$$ which is less than the weight of the block, $W = 5 \times 9.8 = 49 \, \text{N}.$ That is why it is worthwhile talking only about the $x$-acceleration of the block. If you were considering friction, which depends on the normal reaction between the block and the surface, the $y$-component of the applied force would reduce the frictional force on the block by offsetting the weight of the block.
A: In answer to your first question: Yes. You do that.
In answer to your second question: You'll find, if you do that, that it will come out with the magnitude of $12\, \text{N}$, which is what you started with. This is because $\sin^2(x) + \cos^2(x)=1$.
As the floor is horizontal and frictionless you only want the horizontal component of the force as that is the component of the force influencing the horizontal acceleration.
