Law 12.1 Direct free kick, emphasized with the relevant point:
A direct free kick is awarded if a player commits any of the following offences against an opponent condidered by the referee to be careless, reckless or using excessive force:
- charges
- jumps at
- kicks or attempts to kick
- pushes
- strikes or attempts to strike (including head-butt)
- tackles or challenges
- trips or attempts to trip
If an offence involves contact, it is penalised by a dirct free kick.
- Careless is when a player shows a lack of attention or consideration when making a challenge or acts without precaution. No disciplinary sanction is needed
Placing your body in a position that almost guarantees you will be kicked meets this requirement. It should be sanctioned to discourage actions which increase the likelihood of injury, whether to others or yourself. The sanction is a direct free kick for this offence.
If you continued to play this way within the same match, you may be justifiably cautioned for persistent offences under Law 12.3, Disciplinary action.
Had you made the tackle successfully without causing contact, in a way that "threatens injury to someone ... and includes preventing a nearby player from playing the ball for fear of injury" you could and should still be sanctioned with an indirect free kick under Law 12.2, Indirect free kick for playing in a dangerous manner.