What exactly makes you think your phone is being accessed? Having a secure passcode to the phone is one of the easiest way to secure it. Change it if you think somebody has physical access to your device. Use a passcode with your iPhone, iPad, or iPod touch - Apple Support
If you have unwillingly joined a Family Sharing group then read this article if you think your Apple Account has been compromised. --> If you think your Apple Account has been compromised - Apple Support
Use the information in this article to check your Apple ID device list to find where you're signed in --> Review devices signed in to your Apple Account - Apple Support
Related materials:
Personal Safety User Guide
Personal Safety User Guide - Apple Support > open the Table of Contents and review the articles
An article with general information about security and your Apple ID --> Security and your Apple Account - Apple Support
Contact Apple for help with Apple ID account security. This page provides country-specific Apple Support contact information ➞ Contact Apple Support - Apple Support
Also:
How to leave or remove a member from a Family Sharing group - Apple Support