Looking for recommendations

Just bought a house ans now discovering the beauty of doing a few things myself

  1. How would you address the cracks in the first photos

  2. How do you call the foamy material/ join which act as gap fillers avoid cracks etc is it something fairly easy to replace like silicone for example remove and replace?

Clearly not an expert here but will it to learn