The trim wheel is a very helpful tool that makes flying a lot more relaxing. Without it you would be forced to hold the yoke pressure almost all the time while flying around.
On most small airplanes the trim works by moving a trim tab, which is a small control surface usually mounted on the elevator surface itself. This trim tab “flies” the elevator.
See the image above, when the trim tab is deflected downwards it pushes air downwards, which has an equal and opposite reaction creating a force that pushes it up. As it rises it lifts the whole elevator along with it.
As the elevator rises it pushes a lot of air up which causes a downward force on the tail. We experience a downward force on the tail as the aircraft pitching up.
How to think about trim
Do not try to think of trim in terms of up and down while flying. Trim is much simpler if you think of it in terms of forward and back. When you are pulling back on the yoke and holding back pressure, you can roll the trim wheel back to relieve that pressure.
Conversely, if you are holding forward pressure, roll the trim wheel forward and you will feel that pressure decrease.
This is the proper way to use the trim. Control the pitch of the plane with the yoke, and then relieve the pressure with the trim.
How to fly with trim
When flying you should make adjustments to pitch with the yoke because it is more responsive and easier to actively control. Once you have made a change and you are consistently holding pressure then roll the trim wheel to take the pressure off the yoke.
This whole process of setting your pitch attitude usually takes a few seconds. As you gain experience it will be much faster because you will have a sense of what the airplane is doing.
As a rule of thumb, if your airspeed is not changing then you are ready to set the trim and the plane will stay at the same speed once it is set right.
If you are using a simulator, you will likely need to physically release the yoke slowly as you trim. In a real plane, you will just be reducing pressure because the yoke itself will not change from its present position. See the video below for a demonstration of how trim works, and how to use it.