You can carry sunscreen in your cabin bags. You will need to limit the volume to equal or less than 100 ml and place them inside a resealable plastic bag. In case travel-friendly containers do not offer you enough sunscreen, it is fine to bring large amounts if you pack them inside your hold luggage.