You can technically place these special functions anywhere in your contract without any issues.
However, if you want to follow the Solidity style guide as referenced in the documentation, these functions should directly follow the constructor before any other functions:
Order of Functions: Ordering helps readers identify which functions they can call and to find the constructor and fallback definitions
easier.
Functions should be grouped according to their visibility and ordered:
constructor
receive function (if exists)
fallback function (if exists)
external
public
internal
private