Start by adding a Child Theme if you haven't already.
Read the Template Hierarchy link as suggested by slaFFik.
Add the buddypress directory to your child theme.
Copy the main template files you want to edit from wp-content / plugins / buddypress / bp-templates / bp-legacy / buddypress / (XXX / YYY /) zzz.php to the themes / yourchildtheme / BuddyPress / (XXX / YYY / ) zzz.php
If you edit the main files directly, your changes may be lost when updating BP.
source share