Dissonance as a concept has two basic thoughts, one of which being a little more controversial. The first, which is the more commonly used, is that dissonance and consonance are basically relative, existing on a spectrum. The most consonant intervals and harmonies are those that have their overlapping sound wave cycles line up most frequently. An octave is the least dissonant interval, with each of the higher frequency sound cycles lining up with the lower frequency sound cycles 2:1, ie, each sound cycle of the lower frequency happens once in the same amount of time it takes for the higher frequency to happen twice, as pictured below. More dissonant intervals take more cycles for their sound waves to align. This explains why the same intervals tend to sound more dissonant in lower frequency ranges (if you're not familiar, try playing a major 3rd in the middle register of the piano, then toward the low end).
The other thought process for dissonance is the desire to resolve. This generally applies well to the first concept, as the most common approaches to music typically use dissonance as a means of setting up a resolution, eg, the V chord is used to create a tension that wants to resolve to the I chord. This only really becomes controversial when taken to the extreme. Atonal music is basically set up to make no notes more important than any others, so there is no sense of tonic. Because of this, there can be no desire to resolve to any given place, as no given place is any more at rest than another. In this sense, Atonal music is the most consonant music there is, which almost every human that has ever heard it would entirely disagree with.
Dissonance, as most commonly conceptualized, exists on a spectrum and is relative. This means that we can adapt to dissonances and begin to perceive them as more consonant. This is fairly evident within the world of Jazz. Extended chords can sound very dissonant when placed randomly within a piece of music but when the entire piece is made up of extended chords, they sound very consonant, especially compared to the altered chords that are often used to set them up.
With this in mind, it's important to consider your context when you attempt to use dissonance to create tension. Something that would sound fairly dissonant in a Pop song may very well sound entirely consonant within a Jazz song. Additionally, some intervals may sound dissonant on their own but when played within the context of a chord, sound much more consonant. A minor second sounds pretty dissonant on its own but when added to certain chords, it sounds very nice. For example, if you're constructing a minor 7 chord with some extensions, you can place the minor third and the nine directly next to each other, creating a minor second between them, and it can give you a very nice texture that sounds significantly less dissonant than the interval by itself.
One of the more difficult intervals to make sound consonant is the minor 9th. When learning to voice Jazz chords, one of the "rules" is that you should make sure to avoid minor 9ths on any non-dominant-functioning chord, as the dissonance subverts the function of the non-dominant chords. This is pretty well exemplified by creating a major 7 chord. If you voice the root note more than an octave above the 7, you get a minor 9th, which sounds less than at rest and within a major key, Imaj7 should sound fairly at rest. Flip those notes around in your voicing and all of a sudden, it sounds very nice and at rest (within that context). Because of this, when songs that end with the melodic note playing the tonic, the final chord will usually not be a maj7 chord, as it will almost always create the minor 9th (it will often be replaced with a maj6 chord).
So I think what you're looking for would be a mixture of using certain types of intervals/chords that are generally considered dissonant regardless of context (such as b9s, diminished chords, tone clusters) and setting up your dissonances within a given context (such as using strictly triadic harmony and interjecting more complex chords). Using notes from outside the key you're in can also cause dissonance as well but if you listen to enough Jazz, you'll find that playing outside isn't always inherently dissonant.
Beyond all that, there is also a sort of tension that can be derived from arrangement. Learning about the extended techniques of certain instruments can allow you to utilize them to create more tension from the same melodic/harmonic material. For example, on bowed string instruments, playing near the bridge, called Sul Ponticello (I usually just hear this referred to as Ponticello), makes a very scratchy sort of tone. This technique ultimately does create more dissonance, as it emphasizes all of the natural harmonics and with more harmonics being audible, there are more notes, which means more dissonance, as all of the sound waves are then being heard simultaneously (more sound waves needing to line up).
So you can basically create all different sorts of tension and dissonance through different approaches. There is no one way to do it and there aren't necessarily any rules. You're actually more likely to get tension by breaking the "rules", such as with my Jazz example of voicing the chords properly to avoid minor 9ths. As I often do, I'd like to clarify that theory is not a set of rules, it is a language to describe music and an explanation for why it sounds good. The only time there are "rules" are when you're trying to emulate something specific, like if you're trying to sound like Bach, you have to follow proper Classical voice leading rules.