...I'm not a musician ...Don't get too technical
It difficult to answer without being technical.
Defining dissonance breaks down into two general approaches. One tries to consider it an acoustically matter, the other treats it as a stylistic/cultural matter.
Acoustically, dissonance is a sliding scale that looks at the ratio between two pitches placing simple ratios on the consonant end of the scale and progressively complex ratios toward the dissonant end of the scale. A perfect unison of two exactly the same pitches (1:1) is the simplest ratio and consonant. An octave (2:1) is simpler that a perfect fifth (3:2) and considered more consonant. And so on with other pitch combinations.
Stylistically, dissonance is more a matter of music conventions. Consonances and dissonances are defined in a not necessarily scientific way. Musicians use defined dissonances and adhere to stylistic conventions in varying degrees. Audiences respond to the music mostly as a matter of musical culture. A musician may conventionally resolve a dissonant fourth to a consonant third while the audience hears it as a sort of anticipation of a delayed ending, perhaps like the release of a held breathe.
With that background we can compare a perfect fourth (4:3) and a major third (5:4). Acoustically the perfect fourth is more consonant that the major third. Stylistically, the fourth was consonant during the Middle Ages but a dissonance in the 18th Century.
How is dissonance created?
Without going into greater technical detail, you can probably see now that there isn't a single answer. In the end it's prescriptive based on whatever system you are using. It's a tautology. Dissonance is created by playing that which is defined as a dissonance.