OK, you have a mess. The original setup was an S-Trap now, and possibly then, illegal.
As this was a mess to begin with, and you are a DIY without being inspected, I'll give you some advice that will work, but maybe not be per code.
You need to add a vent to this drain, which means you will likely need to use an Air Admittance Valve, or AAV. If you are not comfortable with soldering, you will need to use a rubber coupling (Fernco) to connect the new drain piping to the drain line in the wall. Hopefully you have enough space to do this in the wall and in front of the wall..
Cut out the wall down close to the floor. Cut the copper line inside the wall leaving around 4" sticking up so that you have enough space to clamp on the Fernco. Then make up an assembly like below so that you can install a P-trap to the sink drain. There are various ways to do this, but this is what I would do.
As this was a mess to begin with, and you are a DIY without being inspected, I'll give you some advice that will work, but maybe not be per code.
You need to add a vent to this drain, which means you will likely need to use an Air Admittance Valve, or AAV. If you are not comfortable with soldering, you will need to use a rubber coupling (Fernco) to connect the new drain piping to the drain line in the wall. Hopefully you have enough space to do this in the wall and in front of the wall..
Cut out the wall down close to the floor. Cut the copper line inside the wall leaving around 4" sticking up so that you have enough space to clamp on the Fernco. Then make up an assembly like below so that you can install a P-trap to the sink drain. There are various ways to do this, but this is what I would do.