Rick seems to think that life has very little meaning, and he has been shown to be depressed and suicidal (at least in early episodes). But he also has all kinds of automatic defense systems for his house, his spaceship-made-of-garbage and his person. If he cares so little about his own life, why does he have so many defenses to protect it?
People who are suicidal often* do not want to die.
Suicide and suicidal thoughts are an extremely complicated subject. Many people who do survive an attempt live to regret it:
All 29 people who survived their suicide attempts off San Francisco’s Golden Gate Bridge have said they regretted their decision as soon as they jumped.
— Medium Article on suicide.
Based on Rick's extreme guilt at his life choices, it's understandable that he feels he deserves death. But choosing death is not an easy choice to make, and it's one Rick knows he would instantly regret.
So instead he lives on the knife edge, making reckless decision both grand (his numerous adventures) as well as smaller (his drinking problem), hoping both for death and the chance to make his life feel worthwhile. Because suicide is an irrational response, born as much out of emotion as it is twisted logic it's not contradictory that someone smart could contemplate such a seemingly thoughtless act.
Contrary to attributing Rick's suicidal tendencies to narcism, in many cases and perhaps Rick's, they can arise from a need for control.
Being in want of control may be a relevant and general feature of being suicidal.
Given Rick's intellect, he's keenly aware of how meaningless his life is in comparison to the vast universe, and indeed multiple... That crushing awareness brings with it a sense of not being in control of your life. One thing people who feel suicidal may come to realize is that they can take control by being the one who ends their own seemingly meaningless life.
Rick seems to battle this by spending time with his family, but that is contrastingly a cause for his guilt when he endangers them.
He also vies for control with his numerous defenses, going so far as shown in your second video where a man dies just by touching him.
* Everybody is different, and has a different relationship with suicidal thoughts and tendencies. Please reach out for help if you find yourself feeling this way.