Confusion about Conservation of Mechanical Energy

I'm having a bit of difficulty understanding how to apply the idea of conservation of mechanical energy to a problem. One of the questions on my homework reads:

A physics student shoves a 0.50-kg block from the bottom of a frictionless $30.0°$ inclined plane. The student performs 4.0 J of work and the block slides a distance s along the incline before it stops. Determine the value of s.

From the Work-Energy Theorem I know that $W = \Delta K = -\Delta U_{grav}$

However, since the block begins at rest and eventually stops after sliding up the incline, $V_f = V_i = 0$, so $\Delta K = K_2 - K_1 = 0$

Then logically, any change in the energy of the system must be a result of a change in potential energy, since $\Delta K$ is $0$. That assumption is corroborated by noting that $U_{grav} = mgh$ and that the block's height $h$ increases as it slides up the inclined plane.

Here's where my problem comes in. I'm not sure how to apply the idea of conservation of mechanical energy to solve this problem. I know that if only gravitational force does work, then

$$K_1 + U_{grav,1} = K_2 + U_{grav,2}$$

But what can I do with that in this case, exactly? I know that $K_1 = K_2 = 0$, and since the block starts at the bottom of the ramp, $U_{grav,1} = mgh_1 = 0$, so I just have $U_{grav,2}$ left over. What now?

For example, if $W = \Delta K = -\Delta U_{grav} = K_2 - K_1 = U_{grav,1} - U_{grav,2}$, can I also say that $W = K_2 + U_{grav,2} = K_1 + U_{grav,1}$ so that ultimately $W = U_{grav,2}$ since everything else is $0$? According to your question there is no frictional force therefore all forces are conservative.

Now, if the forces are conservative, then you just need to identify the energy at $t=0$ and when the motion(or whatever) ends.

In your question i am shifting my refernce line just below the box (only for simplicity) and when the block it moved through the distance $s$ the height to which the block raises is $h\sin 30$.

Now, write the equation i will give you the equation which is othe form of work-energy theorem $$W_{external}+W_{conservative}+W_{n-conserv.}=K_2-K_1$$

Now, $W_{ext}=4.0j$ ,

since no friction, $$W_{n-conser.}=0$$ and

$$W_{cons.}=mgh_f-mgh_i$$ $$\implies mg(h\sin 30-0)$$

and you know that block finally stops and so final K.E =0 and from the question it can be maked out initial K.E=0.

so solve the equaltion you will get $h$ which is your required $s$.

NOTE:-

*Conservative forces doesnot depend on the trajectory of motion whereas non-conservative depends. for example if you go by a plane to some altitude or by helicopter(straight up) to the same altitude. work done by gravity will be the same where as for non-conservative this is not true like friction.

I'm finding it difficult to follow your line of reasoning. It seems overly complicated. In the end, I think you are right. But I would start with conservation of energy $$W_\mathrm{external} = \Delta K + \Delta U$$.