What kind of rifle (semi-auto or bolt action?) is it, what caliber are you using? Also, I don't recommend shooting yourself in the heart, not only would be physically difficult to do (unless you made a contraption designed to remotely or indirectly pull the trigger), and also you could fail as the bullet may miss the heart or get lodged or deflect off a rib causing a lot of pain and not instant death.
The best way to ctb via a long gun (rifles and shotguns) is to put the barrel of the gun in your mouth, aimed at an angle (30-45 degrees) and using adequate caliber of ammo, then squeeze the trigger. Do NOT flinch while pulling the trigger as it will shift the position of the barrel away from where you want to hit, resulting in serious injuries but not necessarily death.