A jasmine with long, tangled stems is easier to prune when you know the shape you want to keep. Identify the jasmine first; plants sharing that common name do not all have the same growth or flowering pattern.
Look for the main framework, weak growth and stems that cross through the middle. Decide which parts need support before shortening everything to one height.
Check flowering and pruning timing
The useful pruning window depends on the identified plant and whether it is about to flower or has just finished. A hard cut at the wrong time can remove the display you were waiting for.
Use clean, suitable tools and work in stages so the remaining structure stays visible. Avoid pulling a mature tangled stem into position when it is likely to break; arrange flexible new growth earlier.
If the plant is also growing poorly, review its light and root conditions. A haircut may improve its outline without addressing the reason it became sparse. Keep a photograph before pruning and note what you removed. It makes the next season's growth easier to interpret.
Related reading: Jasmine Care: Light, Watering, Feeding and Pruning.