This is from a study of 43 million people in England looking at myocarditis from the coronavirus and from vaccination.
I'd also add generally aside from the risk of myocarditis being higher from SARS-COV-2 infection than from vaccination, the most significant difference is that vaccination-associated myocarditis is much less severe than infection-associated myocarditis. Furthermore people generally fully recover within the first couple of weeks and months without treatment from vaccination-associated myocarditis. It isn't a reason not to get vaccinated or boosted. And as seen here it may lower your risk of infection-associated myocarditis.
If it is a concern of yours preventing you from getting vaccinated, as this study shows the risk is lower for the Pfizer vaccine as well.