To understand the result you need draw a set of coordinate axes in which to decompose the "vector". What we are doing when we apply Newton's second law is equating vector components in the independent directions of space. In this problem, with no movement out of the page, we have 2 dimensions so every vector will have 2 components, one of which might be zero.
For this type of problem it is customary to decompose the forces acting on the "tilted" block in a coordinate system with one axis along the ramp and the other perpendicular to that ramp. Most books will tell you that this is "easier" because the normal force has only one component (in the direction perpendicular to the ramp), and if there is friction that will also have only one component (parallel to the ramp). The weight of the block needs to be decomposed in to two components, parallel and perpendicular to the ramp. Here is where you need to draw the triangles generated by your coordinates carefully and figure out which direction gets the sine and which the cosine. This is determined by the geometry of the wedge AND your choice of coordinates. I cannot stress this enough, you will get completely different components for different choices of coordinates. For this reason I do not think it's reasonable to cite "an answer". If you re-post the pic with a set of coordinates drawn any one of us can tell you what the components of mg are in that set of coordinates. The final answer should be the same no matter what coordinates you choose.
Also, you seem to be confusing something about the application of Newton's law to this problem as "the force on the block" is not what is being decomposed. It would help to go through the steps carefully.