It would be helpful to know more about the background in doing this because what you can or need to do will depend upon other equipment you have.
With a few small exceptions and iPhone can only accommodate a single Apple Account at a time. If your child is signed into your iPhone then you are, by definition, signed out already. If your child is signed in then you should have the account information for removing the child's account from when you set up the child's account and should do as in this article What to do before you sell, give away, or trade in your iPhone or iPad - Apple Support
For a forgotten/unknown child’s password, refer to the section “Change your child's Apple ID password” in: Change your Apple Account password - Apple Support
Oddly it only tells you how to do this on an Apple mobile device and not on a computer.
If you have an iPhone, iPad or Apple Vision Pro with the latest version of iOS, iPadOS, or visionOS and two-factor authentication turned on for your Apple ID, you can change the Apple ID password for a child account in your Family Sharing group.
1. Tap Settings > Family > your child's account.
2. Tap Apple ID & Password.
3. Tap Change [Child's Name] Password.
4. Enter your device passcode and follow the onscreen instructions.
Apple can also completely reset a device if a person can provide sufficient evidence of valid ownership. Read the requirements and steps for an Activation Lock support request at: https://al-support.apple.com/#/additional-support and links at the bottom right for the type of service requested. Apple says they “may” require "proof of purchase documentation” and that you need “proof of ownership documentation”, but does not detail what currently constitutes proof other than it “must include the product serial number, IMEI or MEID.” User reports on this community indicate that typically Apple will absolutely require, and ONLY accept, an original receipt issued by Apple or an Apple Authorized Reseller. Presumably this is the only kind Apple can authenticate against fraud since Apple is not involved in third party sales. Apple recommends that you "Keep your receipt after you buy an Apple device" --> Keep your receipt after you buy an Apple device - Apple Support
If Apple resets the device this will give you access to the device but won't restore access to the account used to lock it. There is nothing that can be done to expedite an Activation Lock request.