This video shows you how to calculate the required sample size for an independent samples, paired samples and one sample t test. The code can be found here https://drive.google.com/drive/folders/1CDP_4zPooTxjn5l4waI3jlxOSgxDZcs6?usp=sharing