1) make a loop which will be executed as many times as there is piramide levels.
2) calculate how many asterisks should be on current level.
3) calculate how many spaces you need to line up asterisks correctly.
4) Output beeded amount of spaces followed by asterisks.