Sometimes you find that the chainring and sprocket are not quite concentric so as you pedal the chain is sometimes loose, sometimes tight. It may have bounced at one of those loose spots.
Turn the bike upside down and you can back pedal as much as you like.
Put the chain on the sprocket first then just force it onto the chainring by pedalling.
I just use an old towel to clean my chain and any old lube I happen to have. Next time you can, check the chainline and retension the chain. Make sure the chainring isn’t buckled, and the wheel is in square.