I want to specifically talk about behavior that doesn’t affect other people like a bad diet or gambling. Also it doesn’t necessarily have to influence a person’s life so badly, it could be something benign like leaving dirty clothes on the floor. Basically stuff that you know you shouldn’t do but you do it anyway
There is no word or a short phrase that satisfies all the requirements of this question, that is, that it stand for (1) acting against one's considered, rational judgement about what one ought to do, (2) but in a way that does not affect others. (It is unclear whether it is also required that the term be a single word: the question is tagged as a single-word-request, but the title calls for a 'word or phrase'.) Here are, however, some terms that come close to satisfying them.
Lack of self-control
This phrase captures (1) well, but not (2).
Weakness of will
This, again, satisfies (1). Its meaning does not satisfy (2) (i.e. it can be used for the actions that affect others), but it is often used for the actions that fit (2).
Used for the actions that give oneself pleasure and do not affect others directly, although they may affect them indirectly. It is a hyphenated compound, and thus sort of a single word, but not quite. Self-indulgence, however, need not involve acting against one's considered judgement; a self-indulgent person may be convinced that it is OK to act in that way, and may even be able to offer reasons for that judgement.
This term is borrowed from ancient Greek, but it is used often enough in English contexts to be listed as an English word in English dictionaries. It is a single word that satisfies (1) perfectly. It is well suited to actions that fit (2), but its meaning is not limited to them. Its obvious disadvantage is that it will be understood only by those who have had some education in philosophy.
This term is essentially synonymous with akrasia, but readily understood by average English speakers. Its disadvantage is that it is now so often used specifically for the lack of control over one's excretory functions, that it has become awkward to use it in its original, much wider sense.
The only way to satisfy both (1) and (2) fully is by way of a long phrase, such as 'weakness of will with respect to self-regarding actions'.