my only guess is he might have worms
A: He is infected with parasitesB: He's not eating his food (I see in the 1st pic that he is completely ignoring his bowl of food)C: He's naturally dying (is he old for a beagle?)D: His digestive organs are failing (which again ties into him possibly dying)
wtf he was fathe looks okay now
First make sure he's not, like, preparing to die. If he's active and stuff then he's probably okay for now. Nevertheless, take him to the vet.